CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
cmsPerfSuite.PerfSuiteTimer Class Reference

Public Member Functions

def __init__ (self, start=None)
 
def get_duration (self)
 
def get_end (self)
 
def get_start (self)
 
def set_end (self, end=None)
 
def set_start (self, start=None)
 

Public Attributes

 duration
 
 duration_hours
 
 duration_minutes
 
 duration_seconds
 
 end
 
 start
 

Detailed Description

A class defining timing objects to time the running of the various parts of the performance suite. The class depends on module datetime.

Definition at line 33 of file cmsPerfSuite.py.

Constructor & Destructor Documentation

def cmsPerfSuite.PerfSuiteTimer.__init__ (   self,
  start = None 
)
Initialize the start time and set the end time to some indefinite time in the future

Definition at line 35 of file cmsPerfSuite.py.

35  def __init__(self,start=None):
36  """Initialize the start time and set the end time to some indefinite time in the future"""
37  self.start = start
38  self.end = datetime.datetime.max
39  self.duration = self.start - self.end
40 
def __init__(self, start=None)
Definition: cmsPerfSuite.py:35

Member Function Documentation

def cmsPerfSuite.PerfSuiteTimer.get_duration (   self)
Return the duration between start and end as a dictionary with keys 'hours', 'minutes', 'seconds' to express the total duration in the favourite (most appropriate) unit. The function returns truncated integers.

Definition at line 55 of file cmsPerfSuite.py.

55  def get_duration(self):
56  """Return the duration between start and end as a dictionary with keys 'hours', 'minutes', 'seconds' to express the total duration in the favourite (most appropriate) unit. The function returns truncated integers."""
57  self.duration_seconds = self.duration.days*86400 + self.duration.seconds
60  return {'hours':self.duration_hours, 'minutes':self.duration_minutes, 'seconds':self.duration_seconds}
61 
def cmsPerfSuite.PerfSuiteTimer.get_end (   self)
Return the end time in ctime timestamp format

Definition at line 52 of file cmsPerfSuite.py.

52  def get_end(self):
53  """Return the end time in ctime timestamp format"""
54  return self.end.ctime()
def cmsPerfSuite.PerfSuiteTimer.get_start (   self)
Return the start time in ctime timestamp format

Definition at line 49 of file cmsPerfSuite.py.

49  def get_start(self):
50  """Return the start time in ctime timestamp format"""
51  return self.start.ctime()
def cmsPerfSuite.PerfSuiteTimer.set_end (   self,
  end = None 
)
def cmsPerfSuite.PerfSuiteTimer.set_start (   self,
  start = None 
)

Member Data Documentation

cmsPerfSuite.PerfSuiteTimer.duration

Definition at line 39 of file cmsPerfSuite.py.

Referenced by cmsPerfSuite.PerfSuiteTimer.set_end().

cmsPerfSuite.PerfSuiteTimer.duration_hours

Definition at line 59 of file cmsPerfSuite.py.

cmsPerfSuite.PerfSuiteTimer.duration_minutes

Definition at line 58 of file cmsPerfSuite.py.

cmsPerfSuite.PerfSuiteTimer.duration_seconds

Definition at line 57 of file cmsPerfSuite.py.

cmsPerfSuite.PerfSuiteTimer.end
cmsPerfSuite.PerfSuiteTimer.start