5 def __init__(self, prefix, interval,
9 self.interval = interval
10 self.egr_name = egr_name
11 self.ing_name = ing_name
12 self.egress = egr_func
13 self.ingress = ing_func
14 self.egr_prev = self.egress()
15 self.ing_prev = self.ingress()
21 delta = " -- interval %.4f seconds %d %s %d %s" % (self.interval,
27 sys.stderr.write("crunchstat: %s %d %s %d %s%s\n" % (self.prefix,
38 def statlogger(interval, keep, ops):
39 calls = Stat("keepcalls", interval, "put", "get",
42 net = Stat("net:keep0", interval, "tx", "rx",
43 keep.upload_counter.get,
44 keep.download_counter.get)
45 cache = Stat("keepcache", interval, "hit", "miss",
46 keep.hits_counter.get,
47 keep.misses_counter.get)
48 fuseops = Stat("fuseops", interval,"write", "read",
49 ops.write_ops_counter.get,
50 ops.read_ops_counter.get)
51 blk = Stat("blkio:0:0", interval, "write", "read",
52 ops.write_counter.get,