1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
9 def __init__(self, prefix, interval,
13 self.interval = interval
14 self.egr_name = egr_name
15 self.ing_name = ing_name
16 self.egress = egr_func
17 self.ingress = ing_func
18 self.egr_prev = self.egress()
19 self.ing_prev = self.ingress()
25 delta = " -- interval %.4f seconds %d %s %d %s" % (self.interval,
31 sys.stderr.write("crunchstat: %s %d %s %d %s%s\n" % (self.prefix,
42 def statlogger(interval, keep, ops):
43 calls = Stat("keepcalls", interval, "put", "get",
46 net = Stat("net:keep0", interval, "tx", "rx",
47 keep.upload_counter.get,
48 keep.download_counter.get)
49 cache = Stat("keepcache", interval, "hit", "miss",
50 keep.hits_counter.get,
51 keep.misses_counter.get)
52 fuseops = Stat("fuseops", interval,"write", "read",
53 ops.write_ops_counter.get,
54 ops.read_ops_counter.get)
55 blk = Stat("blkio:0:0", interval, "write", "read",
56 ops.write_counter.get,