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

Function stats

nodedb/src/engine/kv/engine.rs:492–504  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

490
491 #[test]
492 fn stats() {
493 let mut e = make_engine();
494 let n = now();
495
496 assert_eq!(e.total_entries(), 0);
497
498 for i in 0..10u32 {
499 e.put(1, "c", &i.to_be_bytes(), &[0; 32], 0, n, Surrogate::ZERO);
500 }
501 assert_eq!(e.total_entries(), 10);
502 assert_eq!(e.collection_len(1, "c"), 10);
503 assert!(e.total_mem_usage() > 0);
504 }
505
506 /// Helper: create a MessagePack-encoded JSON object value.
507 fn mp_obj(fields: &[(&str, &str)]) -> Vec<u8> {

Callers

nothing calls this directly

Calls 3

nowFunction · 0.85
make_engineFunction · 0.70
putMethod · 0.45

Tested by

no test coverage detected