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

Import the module

import clts_pcp

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.

PCP, December 2024

You can use GitHub-flavored Markdown to write your content.

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.0.tar.gz (3.1 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.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clts_pcp-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 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.0.tar.gz
Algorithm Hash digest
SHA256 797e6e8cacc32a5340d2b34016c2347db5ce9f88f005a930529ae55e7b2f5037
MD5 c3af43c6870efac52ccbdba15d8130e5
BLAKE2b-256 9ddf93cf2da10ea512271a9af5464236634a9dcf65892fc2ac07aa307fc27708

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clts_pcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dea3da62632c356a17d153549947cd3ea3e11c63cf400ba64fa9a524bca40610
MD5 c8f5bd9ced1cb8cd9254bdc9ccde3158
BLAKE2b-256 89716bbb40247a329e37f1ca0e9516509e26609d08a386cc83655a2b4b71cf63

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