Merge branch '10497-cwl-job-logs' closes #10497
[arvados.git] / services / fuse / tests / prof.py
1 import time
2
3 class CountTime(object):
4     def __init__(self, tag="", size=None):
5         self.tag = tag
6         self.size = size
7
8     def __enter__(self):
9         self.start = time.time()
10         return self
11
12     def __exit__(self, exc_type, exc_value, traceback):
13         sec = (time.time() - self.start)
14         th = ""
15         if self.size:
16             th = "throughput %s/sec" % (self.size / sec)
17         print "%s time %s micoseconds %s" % (self.tag, sec*1000000, th)