jacdac.timeseries_aggregator

Submodules

Package Contents

Classes

TimeseriesAggregatorClient

Supports aggregating timeseries data (especially sensor readings)

class jacdac.timeseries_aggregator.TimeseriesAggregatorClient(bus: jacdac.bus.Bus, role: str)

Bases: jacdac.bus.Client

Supports aggregating timeseries data (especially sensor readings)
  • and sending them to a cloud/storage service.

  • Used in Jacscript.

  • Note that f64 values are not necessarily aligned.

Implements a client for the Timeseries Aggregator service.

property now Optional[int]

This can queried to establish local time on the device., _: us

property fast_start Optional[bool]

When true, the windows will be shorter after service reset and gradually extend to requested length. This is ensure valid data is being streamed in program development.,

property default_window Optional[int]

Window for timeseries for which set_window was never called. Note that windows returned initially may be shorter if fast_start is enabled., _: ms

property default_upload Optional[bool]

Whether labelled timeseries for which set_upload was never called should be automatically uploaded.,

property upload_unlabelled Optional[bool]

Whether automatically created timeseries not bound in role manager should be uploaded.,

property sensor_watchdog_period Optional[int]

If no data is received from any sensor within given period, the device is rebooted. Set to 0 to disable (default). Updating user-provided timeseries does not reset the watchdog., _: ms

clear() None

Remove all pending timeseries.

update(value: float, label: str) None

Add a data point to a timeseries.

set_window(duration: int, label: str) None

Set aggregation window. Setting to 0 will restore default.

set_upload(upload: bool, label: str) None

Set whether or not the timeseries will be uploaded to the cloud. The stored reports are generated regardless.