Skip to main content

Collecting and listing tasks and timestamps

Project description

clts_pcp

This module allows to measure time lapses through several points in your python script and get a table by the end of the script. The table is gotten in both ASCII and HTML - the HTML version is prepared mainly to be sent through email.

Usage

This module is available at https://pypi.org/project/clts-pcp/.

Install the last version with:

pip install clts_pcp

Import the module

import clts_pcp as clts

Set the context

to set the title of the table (context):

clts.setcontext('Testing lts v2')

and collect an initial timestamp:

tstart=clts.getts()

colect elapsed times

Elapsed time from the start

#(... step 1 )
clts.elapt["step 1 (successful)."]=clts.deltat(tstart)
t1=clts.getts()

Elapsed time from the start

#(... step 2 )
clts.elapt["step 2 (successful)."]=clts.deltat(tstart)

or elapsed time from any previous timestamp:

clts.elapt["step 1-2 (successful)."]=clts.deltat(t1)

get the table

clts.listtimes()
Task(s) by Testing lts v2 watch time (secs) proc time (secs)
step 1 (successful). 2.20 0.00
step 2 (successful). 5.30 0.00
step 1-2 (successful). 3.10 0.00

In the case you want the html version of the table, use:

toemail = clts.listtimes()

and use the toemail as the body of the email.

Deprecation Notice

Versions 1.2.x and earlier of this package are deprecated. Please upgrade to version 2.x.x or later for continued support and new features.

PCP, December 2024

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

clts_pcp-1.0.4.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clts_pcp-1.0.4-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file clts_pcp-1.0.4.tar.gz.

File metadata

  • Download URL: clts_pcp-1.0.4.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for clts_pcp-1.0.4.tar.gz
Algorithm Hash digest
SHA256 da9de4859c40eb094593b77108db4bd8a4bb834b3f900a8a2ddb5db8058c0b54
MD5 8dfe3cfc3e122b4fb45727704ecf1e10
BLAKE2b-256 54995d185f145a68471e6cd8228cea80d5b3bb26268a2546f51a3f1bd2ae5fbe

See more details on using hashes here.

File details

Details for the file clts_pcp-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: clts_pcp-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for clts_pcp-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f11ea70331deeea7a33df621fbde9007064af364e6afdb5b837f3463a7395d03
MD5 f3b404403a1d0a4cb5a3728e995c6278
BLAKE2b-256 44f56789662e914a998d512a81e40706d30f11f669a954e214b704a834d8f843

See more details on using hashes here.

Supported by

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