-
Notifications
You must be signed in to change notification settings - Fork 0
Websocket Protocol
Mario Bielert edited this page Nov 27, 2018
·
1 revision
- All communication is done with JSON objects
These are RPC commands send from the client to the server
The client sends the server a list of metrics it likes to get live data. After this command, the server will send data messages in some interval.
{
'function': 'subscribe',
'metrics': [ METRICS ]
}
Where METRICS
is the comma-separated list of metric ids.
The client notifies the server that it doesn't want to receive any further data messages.
Note: The client may disconnect without ever sending this command.
{
'function': 'unsubscribe'
}
After the subscribe command, the server will send these messages to the client in some interval.
Note: The server may not send any data message for a while if none of the subscribed metrics get an update
{
'data': [ ENTRY,... ]
}
With ENTRY is:
{
'id': 'METRIC',
'ts': 'TIMESTAMP',
'value': 'VALUE'
}
The server may send this message at any time to indicate a problem.
{
'error': 'MESSAGE'
}