...
EvClient interface enables:
Create and destroy EvClient objects.
Connect to and disconnect from event server.
Create and send event message to the server.
Event Server Interface
EvServer interface enables:
Create and destroy a single EvServer object.
Accept incoming EvClient connections.
Receive transmitted EVENTS from the clients.
Process received EVENTS (collecting, reformatting, logging, etc.).
Send formatted EVENTS via MQTT channel.
Events
Requirements
Events transmitted to the remote subscriber must be uniquely identifiable and well formatted. Each EVENT message must contain event CATEGORY and SOURCE (the origin of event) information. Event CATEGORY must define group, phase, and step for this event measures (e.g., DHCP client events), whereas SOURCE defines the process which owns and handles this event AND/OR network interface name this event belongs to.
...
EVENT object consists of following fields resulting from the above description:
ID | Field name | Data type | Description |
---|---|---|---|
1 | TIME | Unix time stamp | UTC time with 1 sec resolution |
2 | MSEC | Integer | Millisecond part of the event time in 0..999 (optional) |
3 | CAT | Enumeration list | Event category |
4 | SOURCE | String | The origin of this event: process, network interface, other. |
5 | SEQ | String | Event sequence information: ONE or START, ... , STOP |
6 | MSG | String | Event message |
...
Implementation of this event-based time measurement system in OpenSync firmware software can be divided into four stages.
Event client shared library for EvClient objects with use of Protocol Buffers schema
Event server for EvServer object
MQTT transmitting channel logic
Generation of EVENTS in the embedded software with use of EvClient library
Event client library
Definition of Protocol Buffer schema for EVENT object / message
Simple API to create, destroy client objects, connect to event server, create and send events to the server
Client library internally take care of time stamp insertions, protobuf encapsulation and sending
Client object shall enable logging of EVENTS in the local logging system with OVSDB configuration
Event Server
Event server is enabled using an OVSDB configuration.
...
This part of implementation includes the following steps:
Identification of all events for time measurement with categorization, sequence and source definition
Updating of event category enumeration list in the protobuf schema
Identification of processes (OpenSync managers) using which the events are generated
Generation of events in selected processes using the EvClient usage pattern
EvClient Usage Pattern
Add initialization code for creation of global EvClient object connected to EvServer.
Insert events identified by Category, Source and Sequence in the proper places of code
Limited use of QM
The QM client-server protocol design is focused on peer-to-peer connection and uses stream sockets. This approach is not suitable for the “many-clients-to-one-server” communication topology. Datagram sockets are therefore used for this purpose instead.
...