orangeqs.juice.schemas.parameter_monitor#
Data Structures for Throttling.
Module Contents#
Classes#
Parameter Monitor configuration. |
|
Base monitoring configuration for individual units. |
|
Throttle state of a monitoring unit. |
|
Throttle state event for pubsub and database update. |
API#
- class orangeqs.juice.schemas.parameter_monitor.ParameterMonitorConfig(/, **data: Any)#
Bases:
orangeqs.juice.settings.ConfigurableParameter Monitor configuration.
This configuration defines the juice parameters to monitor for throttling and their thresholds.
- juice_topic_monitoring_units: dict[str, JuiceTopicMonitorConfig]#
‘Field(…)’
Dictionary of Juice Topic Monitor units.
The key is the unique identifier for the unit, and the value is the configuration for that unit.
- class orangeqs.juice.schemas.parameter_monitor.JuiceTopicMonitorConfig(/, **data: Any)#
Bases:
orangeqs.juice.settings.BaseConfigurableBase monitoring configuration for individual units.
Defines a topic and field to monitor, and thresholds for warning and throttling.
- unit: str#
‘1’
Unit that the value is measured in. Must be compatible with
pint.Unit().Defaults to dimensionless unit.
- monitored_event_type: str#
None
Type of the event to monitor.
This should be the full module path of the event class, e.g.
orangeqs.juice.system_monitor.data_structures.TemperaturePoint.The field specified in
monitored_fieldshould be present in the data of this event.
- throttle_if_larger: float | None#
None
Pause executing experiments if the unit is above a certain value.
- throttle_grace_interval: float#
0.0
Interval between detection of throttled state and actually throttling.
This value can be used if the value can fluctuate. If it is set to non-zero time, system will monitor value for that time to ensure that system should be throttled.
- stop_throttle_if_smaller: float | None#
None
Resume executing experiments if the unit is below a certain value.
In general, this value should be less than
throttle_if_larger. For example, if we are running equipment that is constantly heating up under the load and throttle at 90°C, it may be wise to wait until it cools down to 80°C before resuming experiments.If
throttle_if_largeris specified,stop_throttle_if_smallerwill be set to the same value by default. Ifstop_throttle_if_smalleris larger thanthrottle_if_larger, settings won’t pass validation.
- class orangeqs.juice.schemas.parameter_monitor.ThrottleState(*args, **kwds)#
Bases:
enum.FlagThrottle state of a monitoring unit.
Attributes#
THROTTLED (ThrottleState): The unit is throttled.
WARNING (ThrottleState): The unit is not throttled, but passed the warning threshold.
SAFE (ThrottleState): The unit is not throttled.
- SAFE#
0
- WARNING#
1
- THROTTLED#
2
- class orangeqs.juice.schemas.parameter_monitor.ThrottleStateEvent(/, **data: Any)#
Bases:
orangeqs.juice.messaging.EventThrottle state event for pubsub and database update.
For the global system throttle state,
idshould be set to “SYSTEM” andvalueset to None.- throttled: orangeqs.juice.schemas.parameter_monitor.ThrottleState#
None
Whether the unit is currently throttled.
- value: Any#
None
The value of the monitored parameter.
Marked as None for the global system throttle state.
- id: Annotated[str, tag]#
None
ID for the unit that this event is associated with.
Marked as SYSTEM for the global system throttle state.
- serialize_throttle_state(value: orangeqs.juice.schemas.parameter_monitor.ThrottleState) int#
Serialize the ThrottleState to an integer for storage in InfluxDB.