All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
SortModuleTimes.JobStatsClass Class Reference

Public Member Functions

def __init__
 
def MaxEvents
 
def MinEvents
 
def __iter__
 
def __len__
 
def __getitem__
 
def __setitem__
 

Public Attributes

 name
 
 moduleList
 
 moduleStats
 

Detailed Description

A class collecting timing information from different modules.

This is mostly a dictionary structure, but it is sorted.
The supported interface includes access by key (dictionary-like) or by
position (list-like).

Definition at line 347 of file SortModuleTimes.py.

Constructor & Destructor Documentation

def SortModuleTimes.JobStatsClass.__init__ (   self,
  jobName = None 
)

Member Function Documentation

def SortModuleTimes.JobStatsClass.__getitem__ (   self,
  key 
)

Definition at line 374 of file SortModuleTimes.py.

375  def __getitem__(self, key):
376  if isinstance(key, int): return self.moduleList.__getitem__(key)
else: return self.moduleStats.__getitem__(key)
def SortModuleTimes.JobStatsClass.__iter__ (   self)

Definition at line 372 of file SortModuleTimes.py.

def __iter__(self): return iter(self.moduleList)
def SortModuleTimes.JobStatsClass.__len__ (   self)

Definition at line 373 of file SortModuleTimes.py.

def __len__(self): return len(self.moduleList)
def SortModuleTimes.JobStatsClass.__setitem__ (   self,
  key,
  value 
)

Definition at line 378 of file SortModuleTimes.py.

379  def __setitem__(self, key, value):
380  if isinstance(key, int):
381  if key < len(self.moduleList):
382  if self.moduleList[key].key != value.key:
383  raise RuntimeError(
384  "Trying to overwrite stats of module %s at #%d with module %s"
385  % (self.moduleList[key].key, key, value.key)
386  )
387  # if key mismatch
388  else:
389  self.moduleList.extend([ None ] * (key - len(self.moduleList) + 1))
390  index = key
391  key = value.key
392  else:
393  try:
394  stats = self.moduleStats[key]
395  index = self.moduleList.index(stats)
396  except KeyError: # new stats
397  index = len(self.moduleList)
398  self.moduleList.append(None)
399  #
400  # if ... else
401  self.moduleStats[key] = value
self.moduleList[index] = value
def SortModuleTimes.JobStatsClass.MaxEvents (   self)

Definition at line 360 of file SortModuleTimes.py.

361  def MaxEvents(self):
362  if not self.moduleList: return 0
return max(map(Stats.n, self.moduleList))
def SortModuleTimes.JobStatsClass.MinEvents (   self)

Definition at line 365 of file SortModuleTimes.py.

366  def MinEvents(self):
367  if not self.moduleList: return 0
return min(map(Stats.n, self.moduleList))

Member Data Documentation

SortModuleTimes.JobStatsClass.moduleList

Definition at line 356 of file SortModuleTimes.py.

SortModuleTimes.JobStatsClass.moduleStats

Definition at line 357 of file SortModuleTimes.py.

SortModuleTimes.JobStatsClass.name

Definition at line 355 of file SortModuleTimes.py.


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