Monitor class that will be instantiated in your implementations to monitor the dataflow of your edge system.
The Monitor class is a generic class that can be used to monitor several types of dataflows like boolean, string, float, integers, geographic, etc.
Do you happen to have a use case that is not covered by our ready-to-use classes ? Don’t worry, just contact us at contact@heex.io and we will work with you to provide a custom class.
Monitor Build
To integrate monitors and recorders in your project you have to build with Heex libraries. See HeexSDK integration for details.Monitor main APIs
→ Monitor(id, serverIp, serverPort)- Id : Monitor implementation ID, that can be retrieved on the Heex Cloud
- serverIp : IP address to contact Heex Kernel
- serverPort : Port to contact Heex Kernel
const std::vector<std::string>& messages as you please, and specify the destination implementation ID. You may leave this last one empty, and if so, it’ll broadcast to all other connected implementations.
→ handleMessageFromOtherImplementation(sourceImplementationId, messages) : All implementations can communicate with each other. When a message is received, this callback is called. It is up to you to overload this method and decide what to do with the messages.
→ updateValue(inputValue) : To update the in-memory value of your signal, and communicate with the Heex Kernel when the conditions set on the Heex Cloud are met.
→ updateValue(inputValue, timestamp="") : Call updateValue with the timestamp in the form of a string.
→ updateValueBySignalName(inputValue, timestamp="", signalName="") : Call updateValue but only for the signal with the specified name. Timestamp can be set to "" if you want us to set the timestamp at local time.
These updateValue and updateValueBySignalName APIs are template functions, so you can use them with any type of dataflow, in particular:
- bool : boolean dataflow
- int, uint, short, long : integer dataflow
- float, double : float dataflow
- string, char* : string dataflow
- HeexGps : geographic dataflow (see below)
HeexGps structure
MonitoringSignal structure
Monitor implementation
Let’s write a small example. The Monitor can monitor a speed dataflow in a range.- C++
- Python
You have to include
Monitor.hThen, instantiation is done calling the constructor:awaitReady() allows to wait until your monitor establishes a connection with the Heex Kernel.
The monitor will detect events based on the values that are sent to it, so you should call updateValue() method with the value of your signal. It could be at regular time intervals or when the signal changes. This is highly dependant to your edge system.
To do that, use the following code:
🎉 CONGRATULATIONS! This is it!You don’t need to care about the bounds set in the Heex Cloud when specifying the trigger. All the checking will occur behind the scene and the Heex Agent will take care of detecting when matching conditions are met to trigger events.
ℹ️ Info: timestamp
It is recommended to call UpdateValue method, giving as second argument the exact timestamp of your signal value formatted in ISO 8601-1:2019. Otherwise the current system time is applied by default to your signal value.
For more information go to Timestamp Formatting page.