Stat

The Stat Model

Field

Type

Description

groupKey

Integer, String

Key to group data packets and make server to process them in a strict sequence.

expiryPeriod

Integer

How long the sent data packet is valid (ms). You can use "0" (as a string) to make them "unexpirable" till the next packet send.

payload

JSON required

Any json-represented data you wish the server to process and store.

period

Integer

The sum of values in this field and in server's config file defines how long the sent data packet is valid (ms). If period is not provided, only the server's value will be applied. These ones will be ignored if expiryPeriod is provided.

timestamp

Integer

UNIX timestamp in ms.

Examples

Fully Qualified Stat

{
"groupKey": "gk_893",
"expiryPeriod": 60000",
"payload": {
"statusCode": 200
},
"timestamp": 1620719755782
}
{
"groupKey": "gk_893",
"payload": {
"statusCode": 200
},
"period": 60000,
"timestamp": 1620719755782
}

Shortened Stat

As all of the fields except payload are optional it is possible to send shortened version of the stat. Please compare with the examples above:

{
"statusCode": 200
}