Station Health Model

An implementation of a health model for a station.

class SpsStationHealthModel(subrack_fqdns, tile_fqdns, health_changed_callback, thresholds=None)

A health model for a Sps station.

__init__(subrack_fqdns, tile_fqdns, health_changed_callback, thresholds=None)

Initialise a new instance.

Parameters:
  • subrack_fqdns (Sequence[str]) – the FQDNs of this station’s subracks

  • tile_fqdns (Sequence[str]) – the FQDNs of this station’s tiles

  • health_changed_callback (HealthChangedCallbackProtocol) – callback to be called whenever there is a change to this this health model’s evaluated health state.

  • thresholds (Optional[dict[str, float]]) – the threshold parameters for the health rules

evaluate_health()

Compute overall health of the station.

The overall health is based on the fault and communication status of the station overall, together with the health of the tiles that it manages.

This implementation simply sets the health of the station to the health of its least healthy component.

Return type:

HealthState

Returns:

an overall health of the station

subrack_health_changed(subrack_fqdn, subrack_health)

Handle a change in subrack health.

Parameters:
  • subrack_fqdn (str) – the FQDN of the tile whose health has changed

  • subrack_health (Optional[HealthState]) – the health state of the specified tile, or None if the subrack’s admin mode indicates that its health should not be rolled up.

Return type:

None

tile_health_changed(tile_fqdn, tile_health)

Handle a change in tile health.

Parameters:
  • tile_fqdn (str) – the FQDN of the tile whose health has changed

  • tile_health (Optional[HealthState]) – the health state of the specified tile, or None if the tile’s admin mode indicates that its health should not be rolled up.

Return type:

None