MtuConnectivityMetric#

class wattson.analysis.metrics.network.mtu_connectivity_metric.MtuConnectivityMetric(minimum_timestamp: float | None = None)#

Bases: WattsonMetric

Calculates the Connectivity of the MTU to all RTUs over time.

Methods

__init__

calculate

get_percentage

Returns the percentage value of this metric at the given timestamp.

get_percentages

get_state_color

observe

Start observing

plot_per_rtu

plot_percentage

stop_observe

__init__(minimum_timestamp: float | None = None)#
get_percentage(timestamp: float | None = None) float | None#

Returns the percentage value of this metric at the given timestamp.

Parameters:

timestamp (Optional[float], optional) – The timestamp to return this metric for. If None, the latest known state is returned. (Default value = None)

Returns:

This metric’s value as a percentage. [0, 100]. If the timestamp is out of bounds, None is returned.

Return type:

Optional[float]

observe(wattson_client: WattsonClient, on_change_callback: Callable | None = None, enable_plotting: bool = False, enable_logging: bool = False)#

Start observing

Parameters:
  • wattson_client (WattsonClient) – The WattsonClient to use

  • on_change_callback (Optional[Callable], optional) – The callback to call on metric updates (Default value = None)

  • enable_plotting (bool, optional) – Whether to enable live plotting for this metric (Default value = False)

  • enable_logging (bool, optional) – Whether to enable live logging for this metric (Default value = False)