No project description provided
Project description
Process Monitor
A python tool that utilizes redis to keep track of long-running processes. It triggers a signal every n seconds, so that a health check/monitoring API can view the last signal timestamp.
Requirements
- redis
Configuration
- redis connection parameters to be passed directly to the redis client.
Usage
Consumer
from process_monitor import Monitor
class MyProcess:
def __init__(self):
self.monitor = Monitor(args)
self.monitor.run_signals_worker('process-name')
API - Monitor
from process_monitor import Reader
@route('/check-process')
def check_process():
monitor_reader = Reader(redis_client=Redis(...))
results = monitor_reader.read()
# {'process-name': {
# 'last_signal': '2021-08-03 22:36:55.457416',
# 'last_signal_age': 3,
# 'info': {
# 'x': 1
# }
# }}
return Response(data=results)
Example
Custom Monitors
Kinesis Consumer Monitor
from process_monitor import ConsumerMonitor
class MyConsumer:
def __init__(self):
self.monitor = ConsumerMonitor(args)
self.monitor.run_signals_worker('consumer-name')
def process_record(self, record):
self.monitor.received_record()
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
process_monitor-0.0.1.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file process_monitor-0.0.1.tar.gz.
File metadata
- Download URL: process_monitor-0.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a23ed734e19ab32e0004e797d9498cf269e2cd0c9883ec69750784a73d67b94c
|
|
| MD5 |
194c940a74f07e8eec3cbdbca03baeec
|
|
| BLAKE2b-256 |
13ec6200078f19b2bc3c9ae188230ce6005c1c7723702ca940a4397f6897d1fd
|
File details
Details for the file process_monitor-0.0.1-py2.py3-none-any.whl.
File metadata
- Download URL: process_monitor-0.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1671991bf854e284b017aea4b79c6e892f09233afeb81524902cf3194d149429
|
|
| MD5 |
d2e3cf3718dc657b60c33570909e5582
|
|
| BLAKE2b-256 |
53eb0f0adebcb70b656b94a4e7f041e82b8e640e77d9c8eafc0e942e83cb420e
|