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

Function write_test_segment

nodedb/src/engine/timeseries/columnar_bridge.rs:374–387  ·  view source on GitHub ↗
(count: usize, start_ts: i64)

Source from the content-addressed store, hash-verified

372 // -- Read path tests --
373
374 fn write_test_segment(count: usize, start_ts: i64) -> Vec<u8> {
375 let mut mt = ColumnarMemtable::new_metric(default_config());
376 for i in 0..count {
377 mt.ingest_metric(
378 (i % 5) as u64,
379 MetricSample {
380 timestamp_ms: start_ts + i as i64,
381 value: i as f64 * 0.25,
382 },
383 );
384 }
385 let drain = mt.drain();
386 write_ts_drain_as_segment(&drain, None).expect("write")
387 }
388
389 #[test]
390 fn scan_full_range() {

Callers 5

scan_full_rangeFunction · 0.70
scan_filtered_rangeFunction · 0.70
scan_empty_rangeFunction · 0.70
scan_block_level_skipFunction · 0.70
read_arbitrary_columnFunction · 0.70

Calls 5

default_configFunction · 0.70
ingest_metricMethod · 0.45
drainMethod · 0.45
expectMethod · 0.45

Tested by 5

scan_full_rangeFunction · 0.56
scan_filtered_rangeFunction · 0.56
scan_empty_rangeFunction · 0.56
scan_block_level_skipFunction · 0.56
read_arbitrary_columnFunction · 0.56