Skip to main content

time monitoring

Project description

tprogress

Simple time capturing for python, that logs the time passed since last call with logger level.DEBUG.

How-to

Time Logging

  1. Create tprogress class instance, e.g. timep = tprogress.progress() . Starts the clock.
  2. Call tprogress.elapsed_time (self,stage='') that returns a formatted string with time and in debug mode the time. The argument stage is a string that can be used to state at what stage the program is when called.

Example

  • DEBUG:tprogress:Elapsed Time: 1m 0.683s ( 0: 1:0.7) - Backward Calculation of Rank

Time Monitoring

  1. Create tprogress class instance, e.g. timep = tprogress.progress(max_num=100,step_size=1,freq=5) . Starts the clock.
  2. Call tprogress.monitor() within a large for-loop that tells about how far program is and predicts when the loop is finished. The setting is done in the init call:
  • max_num: Number of loops, e.g. 100
  • step_size: Size of step, e.g. 1
  • freq: How often an info print should be done, e.g. 5, every 5th loop iteration

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tprogress-0.0.6.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

tprogress-0.0.6-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page