ape.parts.countdown.countdown.TimeTracker

class ape.parts.countdown.countdown.TimeTracker(log_level='debug')

A tracker of elapsed time

Param:log_level: level at which to report elapsed times (default=’debug’)
__init__(log_level='debug')
Param:log_level: level at which to report elapsed times (default=’debug’)

Methods

__init__([log_level])
param:log_level: level at which to report elapsed times (default=’debug’)
append(item) Appends the item to the times array
log_error(error[, message]) Logs the error in bold red
percentile(percentile) calculates the percentile (e.g. 50 gets the median (the 50% item))

Attributes

log The logger method indicated by the log_level
logger
return:A logging object.
append(item)

Appends the item to the times array

Param:
  • item: item to append to self.times (a numpy array)
Postcondition:

self.times contains item

log_error(error, message='')

Logs the error in bold red

Param:
  • error: error type (prefix in red and bold)
  • message: descriptive message (red but not bold)
log_update(elapsed)

Outputs to the log the most recent elapsed time information

Param:
  • elapsed: timedelta
percentile(percentile)

calculates the percentile (e.g. 50 gets the median (the 50% item))

Returns:value for percintile of self.times as a timedelta
log

The logger method indicated by the log_level

Returns:logger.debug or logger.info
logger
Returns:A logging object.
times

collection of elapsed times

Navigation