MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / downsample_reduces_points

Function downsample_reduces_points

nodedb/src/engine/timeseries/query.rs:282–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280
281 #[test]
282 fn downsample_reduces_points() {
283 let dir = TempDir::new().unwrap();
284 let (idx, registry) = setup_test_data(&dir);
285 let l1_dir = dir.path().join("l1");
286
287 let engine = TimeseriesQueryEngine::new(&idx, &l1_dir, &registry);
288
289 let full = engine.scan_metrics(1, &TimeRange::new(0, 20000)).unwrap();
290 let downsampled = engine
291 .downsample_metrics(1, &TimeRange::new(0, 20000), 5000)
292 .unwrap();
293
294 assert!(downsampled.len() < full.len());
295 assert!(!downsampled.is_empty());
296 }
297
298 #[test]
299 fn empty_series_returns_empty() {

Callers

nothing calls this directly

Calls 5

setup_test_dataFunction · 0.85
joinMethod · 0.80
scan_metricsMethod · 0.80
downsample_metricsMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected