Skip to main content

Python Application Heartbeats

Documentation Status

A Python application-level heartbeats interface.

Installing

The apphb package is published in the Python Package Index and installable with pip:

pip install apphb

and through Conda Forge:

conda install energymon

To install from source:

pip install .

Usage

The core component is the Heartbeat class. The user defines a window period (window_size) that specifies a sliding window length over which performance is computed. Users may optionally specify other fields to compute sums and rates for.

For example:

total_iters = 10
window_size = 2
hbt = Heartbeat(window_size)
for tag in range(total_iters):
    start_time = time.monotonic()
    application_kernel()
    end_time = time.monotonic()
    hbt.heartbeat(tag, (end_time - start_time,))
    print(str(tag) + ': Instant performance: ' + str(hbt.get_instant_rate()))
    print(str(tag) + ': Window performance: ' + str(hbt.get_window_rate()))
print('Global performance: ' + str(hbt.get_global_rate()))

See the examples directory for more detailed use cases, including specifying custom fields.

Project Source

Find this and related project sources at the libheartbeats organization on GitHub.
This project originates at: https://github.com/libheartbeats/apphb-python

Bug reports and pull requests for bug fixes and enhancements are welcome.

Metadata

Release files for apphb 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apphb 0.1.1
File Size Uploaded
apphb-0.1.1.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for apphb 0.1.1
File Interpreter ABI Platform
apphb-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.8 kB

Release files / apphb-0.1.1.tar.gz

Download URL apphb-0.1.1.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a064086017a79b4c90d57b3105bef5a9436098080e14324d7fdf863a43245081
BLAKE2b-256 checksum
How to use checksums
6342f014784571d26c5e1c3e5f2a2b6e1934236cb96a6749c3284f558f3202df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release files / apphb-0.1.1-py3-none-any.whl

Download URL apphb-0.1.1-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f507449acbb4f817197016b8301df0faf4f7dde31d47500d5d33cc7132421f1
BLAKE2b-256 checksum
How to use checksums
6167999bb52e0005a3b40bff36a7442fb500ed556fcf9d1fbe6e2b111f3945c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page