Tile Health Rules
A file to store health transition rules for tile.
- class TileHealthRules(hw_version, bios_version, preadu_presence, *args, **kwargs)
A class to handle transition rules for tile.
- __init__(hw_version, bios_version, preadu_presence, *args, **kwargs)
Initialise this device object.
- compute_intermediate_state(monitoring_points, min_max, path='', health_key=None)
Compute the intermediate health state for the Tile.
This is computed for a particular category of monitoring points e.g. voltage, io etc.
- Parameters:
monitoring_points (
dict[str,Any]) – dictionary of all the TPM monitoring points for the given category of monitoring pointmin_max (
dict[str,Any]) – minimum/maximum/expected values for the monitoring points. For monitoring points where a minimum/maximum doesn’t make sense, the value provided will be that which the monitoring point is required to have for the device to be healthypath (
str) – the location in the health structure dictionary that is currently being computed.
- Return type:
- Returns:
the computed health state and health report
- property default_thresholds: dict[str, Any]
Get the default thresholds for tile.
- Returns:
the default thresholds
- degraded_rule(intermediate_healths, tile_state)
Test whether DEGRADED is valid for the tile.
- failed_rule(intermediate_healths, tile_state)
Test whether FAILED is valid for the tile.
- healthy_rule(intermediate_healths, tile_state)
Test whether OK is valid for the tile.
- set_logger(logger)
Set logger for debugging.
- unknown_rule(intermediate_healths, tile_state)
Test whether UNKNOWN is valid for the tile.
- deep_merge_dicts(dest, src)
Recursively merges the src dictionary into the dest dictionary.
- For each key in src:
If the key exists in dest and both values are dictionaries, merge them recursively.
Otherwise, overwrite or add the key-value pair in dest with a deep copy from src.
This function modifies the dest dictionary in place and also returns it.
- Example:
>>> dest = {'a': {'b': 1}, 'c': 2} >>> src = {'a': {'d': 3}, 'c': 4} >>> deep_merge_dicts(dest, src) >>> # dest becomes {'a': {'b': 1, 'd': 3}, 'c': 4}
- Parameters:
- Return type:
- Returns:
The destination dictionary.