Public Member Functions | Public Attributes | List of all members
SortModuleTimes.JobStatsClass Class Reference

Public Member Functions

def __init__ (self, jobName=None)
 
def MaxEvents (self)
 
def MinEvents (self)
 
def __iter__ (self)
 
def __len__ (self)
 
def __getitem__ (self, key)
 
def __setitem__ (self, key, value)
 

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 
)

Definition at line 354 of file SortModuleTimes.py.

Member Function Documentation

def SortModuleTimes.JobStatsClass.__getitem__ (   self,
  key 
)

Definition at line 374 of file SortModuleTimes.py.

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

Definition at line 372 of file SortModuleTimes.py.

def SortModuleTimes.JobStatsClass.__len__ (   self)

Definition at line 373 of file SortModuleTimes.py.

def SortModuleTimes.JobStatsClass.__setitem__ (   self,
  key,
  value 
)

Definition at line 378 of file SortModuleTimes.py.

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

Definition at line 360 of file SortModuleTimes.py.

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

Definition at line 365 of file SortModuleTimes.py.

365  def MinEvents(self):
366  if not self.moduleList: return 0
367  return min(map(Stats.n, self.moduleList))
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55

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: