ATLAS Offline Software
Loading...
Searching...
No Matches
python.utils.AtlRunQueryTimer.TimeCount Class Reference
Collaboration diagram for python.utils.AtlRunQueryTimer.TimeCount:

Public Member Functions

 __init__ (self, name)
 __repr__ (self)
 __str__ (self)
 printRecursive (self, lvl)

Public Attributes

 name = name
int totaltime = 0
list subcounts = []

Detailed Description

Definition at line 7 of file AtlRunQueryTimer.py.

Constructor & Destructor Documentation

◆ __init__()

python.utils.AtlRunQueryTimer.TimeCount.__init__ ( self,
name )

Definition at line 8 of file AtlRunQueryTimer.py.

8 def __init__(self, name):
9 self.name = name
10 self.totaltime = 0
11 self.subcounts = []
12

Member Function Documentation

◆ __repr__()

python.utils.AtlRunQueryTimer.TimeCount.__repr__ ( self)

Definition at line 13 of file AtlRunQueryTimer.py.

13 def __repr__(self):
14 return "%s: %f" % (self.name, self.totaltime)
15

◆ __str__()

python.utils.AtlRunQueryTimer.TimeCount.__str__ ( self)

Definition at line 16 of file AtlRunQueryTimer.py.

16 def __str__(self):
17 return "%s: %f" % (self.name, self.totaltime)
18

◆ printRecursive()

python.utils.AtlRunQueryTimer.TimeCount.printRecursive ( self,
lvl )

Definition at line 19 of file AtlRunQueryTimer.py.

19 def printRecursive(self, lvl):
20 from operator import attrgetter
21 # print myself
22 if self.subcounts:
23 # sum up sub counts
24 ts = sum([x.totaltime for x in self.subcounts])
25 print ("%s%-70s : %f (sub sum %f)" % (5*lvl*" ", self.name, self.totaltime, ts))
26 else:
27 print ("%s%-70s : %f" % (5*lvl*" ", self.name, self.totaltime))
28 # sort sub counters
29 sortedByTime = sorted(self.subcounts,key=attrgetter('totaltime'),reverse=True)
30 # call print for sub counters
31 for subtc in sortedByTime:
32 subtc.printRecursive(lvl+1)
33

Member Data Documentation

◆ name

python.utils.AtlRunQueryTimer.TimeCount.name = name

Definition at line 9 of file AtlRunQueryTimer.py.

◆ subcounts

list python.utils.AtlRunQueryTimer.TimeCount.subcounts = []

Definition at line 11 of file AtlRunQueryTimer.py.

◆ totaltime

python.utils.AtlRunQueryTimer.TimeCount.totaltime = 0

Definition at line 10 of file AtlRunQueryTimer.py.


The documentation for this class was generated from the following file: