Managing Measurement History
This guide explains how to save measurements in a local database and retrieve them by their acquisition UID.
1. Enable measurement storage
Storage is disabled until you set storage.filepath in the SRS configuration. Choose a database file path:
{
"storage": {
"filepath": "<path-to-storage-database>"
}
}
Restart the auditor after changing the storage path. See Storage for more information.
2. Save the measurement UID
First, request a measurement with get acq as described in Obtaining Measurements. Save the uid from its measurement-info response. Later, use that UID with get measurement to retrieve the saved data.
3. Request the saved measurement
Send get measurement with the UID in its payload. End the JSON request with a zero byte. See Communication Protocol for packet framing.
{
"get": "measurement",
"payload": {
"uid": "17092444-db1f-4115-8461-622b68413080"
}
}
If found, the response payload contains the timestamp, attributes, and a base64-encoded, zlib-compressed BTDM blob:
{
"type": "measurement",
"payload": {
"uid": "17092444-db1f-4115-8461-622b68413080",
"timestamp": "2023-10-30T13:47:41.455-05:00",
"attribs": { "measurement-type": "regular" },
"btdm_z_b64": "<base64-encoded-blob>"
}
}
An unknown UID returns an error. Use get recent-measurements to list saved measurements. Its payload accepts earliest as a date-time string, limit from 0 to 100, and offset. Defaults are 2020-01-01T00:00:00Z, 10, and 0 respectively. Each result contains uid, timestamp, attribs, and btdm_z_b64.
To create a .btdm file, base64-decode btdm_z_b64 and inflate it with zlib. Send the file to Tessonics for algorithm debugging if needed.