示例#1
0
文件: cache.py 项目: opmuse/opmuse
    def _total_bytes(self):
        total_bytes = 0

        for key, item in cache.storage.values():
            bytes = total_size(item['value'])
            total_bytes += bytes

        return total_bytes
示例#2
0
文件: admin.py 项目: opmuse/opmuse
    def cache(self):
        values = []

        total_bytes = 0

        for key, item in cache.storage.values():
            bytes = total_size(item['value'])
            total_bytes += bytes
            values.append((key, bytes, type(item['value']), item['updated']))

        return {
            'values': values,
            'size': cache.storage.size(),
            'total_bytes': total_bytes
        }