self.download_counter = Counter()
self.put_counter = Counter()
self.get_counter = Counter()
+ self.hits_counter = Counter()
+ self.misses_counter = Counter()
if local_store:
self.local_store = local_store
locator = KeepLocator(loc_s)
slot, first = self.block_cache.reserve_cache(locator.md5sum)
if not first:
+ self.hits_counter.add(1)
v = slot.get()
return v
+ self.misses_counter.add(1)
+
# If the locator has hints specifying a prefix (indicating a
# remote keepproxy) or the UUID of a local gateway service,
# read data from the indicated service(s) instead of the usual
net = Stat("net:keep0", interval, "tx", "rx",
keep.upload_counter.get,
keep.download_counter.get)
+ cache = Stat("keepcache", interval, "hit", "miss",
+ keep.hits_counter.get,
+ keep.misses_counter.get)
fuseops = Stat("fuseops", interval,"write", "read",
ops.write_ops_counter.get,
ops.read_ops_counter.get)
time.sleep(interval)
calls.update()
net.update()
+ cache.update()
fuseops.update()
blk.update()