| edition = "2023"; |
| |
| package milotic_hft; |
| |
| import "telemetry_aggregation.proto"; |
| import "sensor_identifier.proto"; |
| |
| // State of telemetry data. This should be updated if necessary to match the |
| // tlBMC Status enum. |
| // LINT.IfChange |
| enum Status { |
| // Data has not been initialized by the collector. |
| // Default state on boot. |
| STATUS_UNKNOWN = 0; |
| // Fresh data ready to be served. |
| STATUS_OK = 1; |
| // State when data refresh timed out or an error occurred preventing future |
| // refreshes. |
| STATUS_STALE = 2; |
| // State when sensor creation failed or is pending some precondition to be |
| // created. |
| STATUS_MISSING = 3; |
| } |
| // LINT.ThenChange(//depot/google3/third_party/milotic/external/cc/tlbmc/store/store_hft_adapter.cc) |
| |
| message State { |
| Status status = 1; |
| string status_message = 2; |
| } |
| |
| message HighFrequencySensorReading { |
| oneof reading { |
| float float_reading = 1; |
| uint64 count = 3; |
| // Add support for other types of readings. |
| } |
| // Nanosecond timestamp of when the reading was collected/polled by the |
| // software. |
| int64 timestamp_ns = 2; |
| // Nanosecond timestamp of the original source value (e.g., hardware timestamp |
| // or shared memory update timestamp). For native/direct sensors, this is |
| // identical to timestamp_ns. |
| int64 source_timestamp_ns = 4; |
| } |
| |
| message HighFrequencySensorsReadings { |
| repeated HighFrequencySensorReading timestamped_readings = 1; |
| SensorIdentifier sensor_identifier = 2; |
| State state = 3; |
| } |
| |
| message HighFrequencySensorsReadingsBatch { |
| repeated HighFrequencySensorsReadings high_frequency_sensors = 1; |
| int32 configured_sampling_interval_ms = |
| 2; // If set, it means all sensors in high_frequency_sensors has been |
| // configured to the same sampling interval |
| } |
| |
| message SensorAggregationsStateChange { |
| int64 timestamp_ns = 1; |
| AggregationColor previous_color = 2; |
| AggregationColor current_color = 3; |
| bool state_change = 4; |
| } |
| |
| message SensorAggregation { |
| SensorIdentifier sensor_identifier = 1; |
| repeated SensorAggregationsStateChange state_changes = 2; |
| // If true, the sensor aggregation should be delivered to the client. |
| bool deliver = 3; |
| reserved 4, 5, 6, 7, 8, 9; |
| } |
| |
| message SensorAggregations { |
| repeated SensorAggregation aggregation = 1; |
| } |