Feature request: New attribute event ALARM_EVENT
This is a feature request for a new attribute event (working title: ALARM_EVENT, real name TBD).
Synopsis
Given this hypothetical but not unlikely situation:
- There exist 100000 attributes in a system.
- The system has one or more devices that are tasked to monitor if any of the attribute values in other devices have reached the warning or alarm level for that respective attribute.
- Potential use case: This allows to keep an immediate timestamped record of attribute values that are within warning or alarm range.
In the current situation (cppTango 9.3.5) the monitoring device has only one logical option to perform the task:
- Subscribe to
CHANGE_EVENT
of the attributes. TheCHANGE_EVENT
will indicate a change in theQUALITY_FACTOR
(ATTR_VALID, ATTR_INVALID, ATTR_ALARM, ATTR_CHANGING, ATTR_WARNING).- Exploiting the
QUALITY_FACTORY
has here a real catch, because theQUALITY_FACTOR
can be independently set from an attribute's value. Meaning: An attribute value can be in warning or alarm range, but theQUALITY_FACTOR
has been set toATTR_VALID
.
- Exploiting the
Unfortunately could the impact of such a solution be severe:
- The device will receive an event for every change bigger or equal to the configured delta value for every attribute.
- The device needs to know for every attribute what the warning and alarm levels are.
- The device needs to filter out all events that indicate a value that falls within nominal range.
Unsuitable solutions:
- Subscription to
PERIODIC_EVENT
is unsuitable because values could reach warning or alarm levels and go back to nominal level within the configured period. - Subscription to
QUALITY_EVENT
: This event is labelled as deprecated, hence one must not use it. - Manual polling client-side. This should be avoided, because it is just a reversal of the change-event situation. A lot of polls will be performed but the result be discarded.
What is the proposal?
Introduce a new event type: ALARM_EVENT (working title, real name TBD)
The new event can be automatically published by the polling thread or manually by the developer. The event comes in three flavours:
-
WARNING
: ThisALARM_EVENT
flavour is published when an attribute value enters the warning range. This is also true when an attribute value leaves the alarm range and enters the warning range again. -
ALARM
: ThisALARM_EVENT
flavour is published when an attribute value leaves the warning range and enters the alarm range. -
NORMAL
: ThisALARM_EVENT
flavour is published when an attribute value leaves the warning range.
Note: The events are sent once and not continuous.
Publishing of the new ALARM_EVENT
Automatic publishing
When a polling loop is active, it performs the publishing of ALARM_EVENT
.
Manual publishing
As is it possible with other events, too, an ALARM_EVENT
with its three flavours can be published from the code wherever the developer decides to.
Error handling
The error handling during automatic ALARM_EVENT assessment follows exactly the same handling that is already implemented for the other events. See this comment for details.
ALARM_EVENT
is available?
What benefits do I expect once the new - Very low impact use of the ZMQ event system to allow clients to monitor very efficiently if any of 100000s of attributes are outside their nominal range.
What risks are to be expected?
None if unused.
Reason: If the new event type is not used, it will have zero impact on device servers, devices or clients.
Very low if used.
Reason: As soon as the new event type is used with automatic polling/publishing, the expected impact is very low because events will only be sent once for each transition between nominal
Impacted Tango Controls subsystems?
- tango-idl: Add the new event.
- cppTango: Add the new event. Creation, subscription, submission, removal subscription cancelling.
- pytango: Amend the extension library to cover the new API. Add the new event. Creation, subscription, submission, removal subscription cancelling.
- jTango: Creation, subscription, submission, removal subscription cancelling.
- Tooling (Jive, etc.): Displaying and configuration of the new event.
The new feature is expected in what Tango Controls version?
It is a new feature which introduces an additional functionality. Therefore I would advise to introduce it as a new feature in cppTango 9.4.x with the other tools immediately following up.