MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_memory_allocation_tracking

Function test_memory_allocation_tracking

src/protocol/memory_monitor.rs:447–459  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

445
446 #[test]
447 fn test_memory_allocation_tracking() {
448 let monitor = MemoryMonitor::new();
449
450 monitor.record_buffer_allocation(1024);
451 monitor.record_message_allocation(2048);
452 monitor.record_query_allocation(512);
453
454 let stats = monitor.get_stats();
455 assert_eq!(stats.total_bytes(), 3584);
456 assert_eq!(stats.buffer_pool_bytes, 1024);
457 assert_eq!(stats.message_bytes, 2048);
458 assert_eq!(stats.query_bytes, 512);
459 }
460
461 #[test]
462 fn test_memory_deallocation() {

Callers

nothing calls this directly

Calls 4

get_statsMethod · 0.45

Tested by

no test coverage detected