Skip to main content

Telemetry Protocol (Device Metrics)

Telemetry is the heartbeat of device monitoring. Each device sends a data packet (Payload) to the server at a fixed frequency (default: every 5 minutes). The data is collected in src/telemetry, normalized, and saved in the DeviceMetrics table.

Data Structure (Payload JSON)

The complete Payload includes dozens of fields, divided into categories:

{
"cpuUsage": 45.2, // Usage percentage
"ramUsage": 600, // RAM in use (MB)
"batteryLevel": 98,
"isCharging": true,
"temperature": 38.5, // CPU/Battery temperature
"network": {
"type": "WIFI",
"ssid": "Synagogue-Guest",
"signalStrength": -65, // dBm
"latency": 45
},
"runningApps": ["com.btmanagement.gabaismart", "com.google.android.youtube"],
"screen": {
"isOn": true,
"brightness": 255
}
}

Reliability Mechanism (Retry Logic)

The TelemetryService implements a Retry with Backoff mechanism against the database:

  • Since telemetry generates high write load (Write Heavy), in case of table lock (Deadlock) or momentary DB load, the server will try to save the record again up to 5 times before giving up.
  • This ensures that critical data is not lost even under load.

Data Consumption (Analytics)

The data can be queried in several dimensions:

  1. Raw History: Raw history for charts (CPU over time).
  2. Aggregated: Averages (for example: "What is the average memory of all devices on version 2.1?").
  3. Latest: Current status (used for quick Online/Offline indication).