MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / test_minute

Function test_minute

chirpstack/src/storage/metrics.rs:317–349  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

315
316 #[tokio::test]
317 async fn test_minute() {
318 let _guard = test::prepare().await;
319
320 let records = vec![
321 Record {
322 time: Local.with_ymd_and_hms(2018, 1, 1, 1, 1, 0).unwrap(),
323 kind: Kind::ABSOLUTE,
324 metrics: [("foo".into(), 1f64), ("bar".into(), 2f64)]
325 .iter()
326 .cloned()
327 .collect(),
328 },
329 Record {
330 time: Local.with_ymd_and_hms(2018, 1, 1, 1, 1, 10).unwrap(),
331 kind: Kind::ABSOLUTE,
332 metrics: [("foo".into(), 4f64), ("bar".into(), 4f64)]
333 .iter()
334 .cloned()
335 .collect(),
336 },
337 Record {
338 time: Local.with_ymd_and_hms(2018, 1, 1, 1, 2, 0).unwrap(),
339 kind: Kind::ABSOLUTE,
340 metrics: [("foo".into(), 5f64), ("bar".into(), 6f64)]
341 .iter()
342 .cloned()
343 .collect(),
344 },
345 ];
346 for r in &records {
347 save("test", r, &[Aggregation::MINUTE]).await.unwrap();
348 }
349 }
350
351 #[tokio::test]
352 async fn test_hour() {

Callers

nothing calls this directly

Calls 3

prepareFunction · 0.85
unwrapMethod · 0.80
saveFunction · 0.70

Tested by

no test coverage detected