ATLAS Offline Software
Public Member Functions | Static Public Attributes | List of all members
python.utils.AtlRunQueryTimer.TimerStats Class Reference
Collaboration diagram for python.utils.AtlRunQueryTimer.TimerStats:

Public Member Functions

def saveTimeFlat (cls, exectime)
 
def saveTime (cls, exectime)
 
def printTimeSummary (cls)
 
def printTimeFlat (cls)
 

Static Public Attributes

int level = 0
 
 total = TimeCount('total')
 
dictionary totalFlat = {}
 
list context = []
 

Detailed Description

Definition at line 39 of file AtlRunQueryTimer.py.

Member Function Documentation

◆ printTimeFlat()

def python.utils.AtlRunQueryTimer.TimerStats.printTimeFlat (   cls)

Definition at line 80 of file AtlRunQueryTimer.py.

80  def printTimeFlat(cls):
81  for name, [_time, callcount] in sorted(cls.totalFlat.items(),key=lambda x: x[1][0]):
82  print ("%-70s : %f (%i)" % (name, _time, callcount))
83 
84 
85 @contextmanager

◆ printTimeSummary()

def python.utils.AtlRunQueryTimer.TimerStats.printTimeSummary (   cls)

Definition at line 72 of file AtlRunQueryTimer.py.

72  def printTimeSummary(cls):
73  #import pickle
74  #f = open("timecount.pickle","w")
75  #pickle.dump(cls.total,f)
76  #f.close()
77  cls.total.printRecursive(0)
78 

◆ saveTime()

def python.utils.AtlRunQueryTimer.TimerStats.saveTime (   cls,
  exectime 
)

Definition at line 55 of file AtlRunQueryTimer.py.

55  def saveTime(cls, exectime):
56  cur = cls.total # a TimeCount instance
57  for n in cls.context:
58  if n=='total':
59  cur = cls.total
60  continue
61  try:
62  idx = cur.subcounts.index(n)
63  print ('index', idx)
64  cur = cur.subcounts[idx]
65  except ValueError:
66  cur.subcounts += [TimeCount(n)]
67  cur = cur.subcounts[-1]
68  cur.totaltime += exectime
69  cls.saveTimeFlat(exectime)
70 

◆ saveTimeFlat()

def python.utils.AtlRunQueryTimer.TimerStats.saveTimeFlat (   cls,
  exectime 
)

Definition at line 46 of file AtlRunQueryTimer.py.

46  def saveTimeFlat(cls, exectime):
47  n = cls.context[-1]
48  if n not in cls.totalFlat:
49  cls.totalFlat[n] = [0,0]
50  cls.totalFlat[n][0] += exectime
51  cls.totalFlat[n][1] += 1
52 
53 

Member Data Documentation

◆ context

list python.utils.AtlRunQueryTimer.TimerStats.context = []
static

Definition at line 43 of file AtlRunQueryTimer.py.

◆ level

int python.utils.AtlRunQueryTimer.TimerStats.level = 0
static

Definition at line 40 of file AtlRunQueryTimer.py.

◆ total

python.utils.AtlRunQueryTimer.TimerStats.total = TimeCount('total')
static

Definition at line 41 of file AtlRunQueryTimer.py.

◆ totalFlat

dictionary python.utils.AtlRunQueryTimer.TimerStats.totalFlat = {}
static

Definition at line 42 of file AtlRunQueryTimer.py.


The documentation for this class was generated from the following file:
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79