Metrics Logging

Clients for the metrics logging service.

exception bosdyn.client.metrics_logging.MissingKeysError(response, error_message=None)[source]

Bases: ResponseError

Metrics requested from the metrics service did not exist.

exception bosdyn.client.metrics_logging.UnableToOptOutError(response, error_message=None)[source]

Bases: ResponseError

Unable to opt-out of metrics logging due to invalid license permissions.

class bosdyn.client.metrics_logging.MetricsLoggingClient[source]

Bases: BaseClient

A client for the metrics logging service on the robot.

default_service_name = 'metrics-logging'
service_type = 'bosdyn.api.metrics_logging.MetricsLoggingRobotService'
get_metrics(keys=None, include_events=False, **kwargs)[source]

Get metrics from the robot.

Parameters:
  • keys (List[strings]) – A list of strings representing the keys for metrics that should be returned.

  • include_events (bool) – Whether events should be included in the response.

Returns:

The GetMetricsResponse response.

Raises:

RpcError – Problem communicating with the robot.

get_metrics_async(keys=None, include_events=False, **kwargs)[source]

Async version of get_metrics().

get_store_sequence_range(**kwargs)[source]

Determine the range of sequence numbers currently being used by the metrics system’s store.

Returns:

A list where the first number represents the starting index (inclusive), and the second number represents the final index (inclusive) for the entries in the metrics store.

Raises:

RpcError – Problem communicating with the robot.

get_store_sequence_range_async(**kwargs)[source]

Async version of get_store_sequence_range().

get_absolute_metric_snapshot(sequence_numbers, **kwargs)[source]

Get absolute metric snapshots for specific sequence numbers’ entries.

Parameters:

sequence_numbers (List(int)) – The list of sequence numbers whose entries should be returned as absolute metric snapshots.

Returns:

A list of signed_proto_pb2.SignedProto(). Each signed proto will contain the serialized absolute_metric_pb2.AbsoluteMetricsSnapshot() for the requested sequence number’s timestamp. The robot will exclude snapshots if the sequence number does not exist, or the response will exceed the grpc limit.

Raises:

RpcError – Problem communicating with the robot.

get_absolute_metric_snapshot_async(sequence_numbers, **kwargs)[source]

Async version of get_absolute_metric_snapshot().

bosdyn.client.metrics_logging.make_parameter_update(label, value, is_incremental, units='', notes='')[source]

Create a parameter update proto from the label, param value, and if it is incremental.