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 38 of file AtlRunQueryTimer.py.

Member Function Documentation

◆ printTimeFlat()

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

Definition at line 79 of file AtlRunQueryTimer.py.

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

◆ printTimeSummary()

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

Definition at line 71 of file AtlRunQueryTimer.py.

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

◆ saveTime()

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

Definition at line 54 of file AtlRunQueryTimer.py.

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

◆ saveTimeFlat()

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

Definition at line 45 of file AtlRunQueryTimer.py.

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

Member Data Documentation

◆ context

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

Definition at line 42 of file AtlRunQueryTimer.py.

◆ level

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

Definition at line 39 of file AtlRunQueryTimer.py.

◆ total

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

Definition at line 40 of file AtlRunQueryTimer.py.

◆ totalFlat

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

Definition at line 41 of file AtlRunQueryTimer.py.


The documentation for this class was generated from the following file:
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename R::value_type > sorted(const R &r, PROJ proj={})
Helper function to create a sorted vector from an unsorted range.
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:71