Skip to main content

Library for sending pulses to a process monitoring server

Project description

Python Heartbeat Library

The Python Heartbeat Library is a simple utility that allows you to send regular "pulses" to a specific endpoint. These pulses serve as confirmation that your main script is functioning correctly. If the main script stops for any reason, the heartbeat will also cease, indicating that something went wrong.

Installation

You can install the Python Heartbeat Library using pip:

pip install pyheartbeat

Example

======================================================================================================
from pyheartbeat import setUrl, heartbeat, killHeartbeat

# Set the URL for sending pulses
setUrl("https://your_url")

# Start the heartbeat with a pulse every x seconds
heartbeat(interval = 600, name = 'process name', description = 'process description',
additional_info = 'additional info', show_response = True, show_logs = True)

# Your main script logic goes here...

# When your script ends or encounters an error, stop the heartbeat
killHeartbeat()
======================================================================================================

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

pyheartbeat-0.0.4.tar.gz (3.7 kB view hashes)

Uploaded Source

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