pub fn encode_snapshot(
agent_id: String,
start: i64,
end: i64,
metrics: HashMap<String, Vec<(i64, f64)>>,
threshold: usize,
) -> Result<Vec<u8>, Box<dyn Error>>Expand description
Encode metrics as a 5-minute snapshot with LTTB downsampling per metric
§Arguments
agent_id- Agent identifierstart- Window start timestamp (ms)end- Window end timestamp (ms)metrics- Map of metric_name -> [(timestamp, value), …]threshold- LTTB downsampling threshold (points per metric)
§Returns
MessagePack-encoded snapshot ready for HTTP POST