Telemetry package aimed for PyROS
Project description
Telemetry
PyROS aimed telemetry client. This library gives definition of telemetry concepts:
- stream (logger, stream definition): TelemetryLogger, TelemetryStreamDefinition...
- client: TelemetryClient
- storage: TelemetryStorage,
and implementaions.
Stream
Stream represents concept of well formed data (fixed len byte record) logged by source app, service or program; that contains data of interest. Stream can be defined using subclass of TelemetryStreamDefinition:
-
MQTTLocalPipeTelemetryLogger provides all-in-one client to start logging your data to local server over local unix pipe (it is expected server to be already running locally). It uses MQTT to negotiate creation of stream from given definition.
-
In telemetry-server package check SocketTelemetryServer class which allows you to get instance of TelemetryLogger to start logging to locally running TCP server.
Example:
logger = MQTTLocalPipeTelemetryLogger('test-stream', host="172.24.1.185", port=1883)
logger.add_byte('some-status')
logger.add_double('x-coordinate')
logger.add_double('y-coordinate')
logger.init()
# ...
logger.log(1, 55, 0.0, 0.0) # first argument is timestamp
logger.log(1.23, 0, 2.1, 0.0)
logger.log(1.90, 0, 2.2, 1.0)
Client
Client provides way of accessing telemetry data. For instance:
client = MQTTTelemetryClient(host=host, port=port, topic=topic)
test_stream = None
test_stream_data = None
def receive_stream_def(received_stream):
global test_stream
test_stream = received_stream
def receive_test_stream_data(received_records):
global test_stream_data
test_stream_data = received_records
client.getStreamDefinition('test-stream', process_stream_def)
while test_stream is None:
time.sleep(0.01)
# second argument is start timestamp, third end timestamp and last callback method to deliver data
client.retrieve(test_stream, 0, time.time(), receive_test_stream_data)
Client functions operate with callbacks. Methods would request data but result is delivered asynchronously.
Storage
Storage is mostly used internally by client and server implementations
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
Built Distribution
File details
Details for the file pyros-telemetry-1.0.1.tar.gz
.
File metadata
- Download URL: pyros-telemetry-1.0.1.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ce2bc153fea2d580561109f0b9af52ace761772fb058a911bcf84614b4dd1cf |
|
MD5 | 1cb2573b36ad83e7a9badda840f2ed03 |
|
BLAKE2b-256 | 1aff4e21b211fffe92109f9623ccf7cb4c558fe7d4db69d057a6c591bebc3710 |
File details
Details for the file pyros_telemetry-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: pyros_telemetry-1.0.1-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 971c2c1ca788f31c6f07753c992e4d6f7de09b1853c2de2b1bf5ce7a72b10beb |
|
MD5 | 21cd2333e0b77cc46a94d24e57b5476c |
|
BLAKE2b-256 | 86ecaca40009a3af62c11ecc28589a07c610b1bfbd9422b06f1b80177033fcda |