Skip to main content

Collect client data and display on monitor

Project description

Multi process monitor

This is a small helper library intended for monitoring multiple processes outputting the same data set, visualizing it in a ncurses table.

Example: Multiple scrapers processing different URLs logging their progress to one central monitoring entity.

Installation

pip install clientmonitor

Usage

This library consists of a server and a client. The Server accepts connections from clients and prints data received from the clients.

The clients expect the server to be running before connecting.

Running the server

Port and secret are mandatory, host is optional and only relevant if server and client are not being run on the same machine.

from clientmonitor.Server import Server

server = Server(6666, "secret", host="localhost")
server.set_columns([
  {
    "key": "key1",
    "label": "Label for Key 1"
  },
  {
    "key": "key2",
    "label": "Label for Key 2"
  }
])
server.start()

# CTRL-C to stop

The columns being set are the columns that are expected to be received as data from the clients and are what the server will print.

Running the client

import time
from clientmonitor.Client import Client

client = Client("client-1", 6666, "secret")
client.connect()

for i in range(0, 5):
  client.send({
    "key1": 100 + i,
    "key2": 200 + i,
  })

  time.sleep(5)

client.close()

Development

Pull request are welcome, pleas address them against the develop branch.

Publish

python -m build
python3 -m twine upload --repository testpypi dist/*

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

clientmonitor-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

clientmonitor-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file clientmonitor-0.1.0.tar.gz.

File metadata

  • Download URL: clientmonitor-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for clientmonitor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 22c869a22ab5851b39b1c2c0a8da838d09408e6fabf6fae08a743a9d69683dfe
MD5 98d2cc996bbd5f865ce83da4d9778008
BLAKE2b-256 91e2e1ebeab7f7f86ef500afb2c7f7b1e52e38f32ff7ad04b91e4bad098dc472

See more details on using hashes here.

File details

Details for the file clientmonitor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: clientmonitor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for clientmonitor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 456508526133e602c1a38af30acbf661accc7bc0e469cf0a1a1d9cdcf3389a39
MD5 6f46030a258ead8d672e756651f2c665
BLAKE2b-256 6b6605187940a4772486f192c6ddaaf375810a722f1c552077751974fe93514b

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