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 32 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 34 of file cmsPerfSuite.py.

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

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 54 of file cmsPerfSuite.py.

54  def get_duration(self):
55  """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."""
56  self.duration_seconds = self.duration.days*86400 + self.duration.seconds
59  return {'hours':self.duration_hours, 'minutes':self.duration_minutes, 'seconds':self.duration_seconds}
60 
def cmsPerfSuite.PerfSuiteTimer.get_end (   self)
Return the end time in ctime timestamp format

Definition at line 51 of file cmsPerfSuite.py.

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

Definition at line 48 of file cmsPerfSuite.py.

48  def get_start(self):
49  """Return the start time in ctime timestamp format"""
50  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 38 of file cmsPerfSuite.py.

Referenced by cmsPerfSuite.PerfSuiteTimer.set_end().

cmsPerfSuite.PerfSuiteTimer.duration_hours

Definition at line 58 of file cmsPerfSuite.py.

cmsPerfSuite.PerfSuiteTimer.duration_minutes

Definition at line 57 of file cmsPerfSuite.py.

cmsPerfSuite.PerfSuiteTimer.duration_seconds

Definition at line 56 of file cmsPerfSuite.py.

cmsPerfSuite.PerfSuiteTimer.end
cmsPerfSuite.PerfSuiteTimer.start