File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 55mod common;
66
77use common:: load_test_concurrent;
8- use memory_benchmarking:: { BencherOutput , trace_memory_async} ;
9- use std:: time:: Duration ;
8+ use memory_benchmarking:: { MemoryMetrics , trace_memory_async} ;
9+ use std:: { collections :: HashMap , time:: Duration } ;
1010
1111pub fn main ( ) {
1212 let samples: Vec < _ > = ( 0 ..10 )
@@ -32,8 +32,11 @@ pub fn main() {
3232 } )
3333 . collect ( ) ;
3434
35- let serialized_metrics = serde_json:: to_string_pretty ( & BencherOutput :: from ( samples. as_slice ( ) ) )
36- . expect ( "Failed to serialize benchmark output." ) ;
35+ let serialized_metrics = serde_json:: to_string_pretty ( & HashMap :: from ( [ (
36+ "scrape_memory_usage" ,
37+ MemoryMetrics :: from ( samples. as_slice ( ) ) ,
38+ ) ] ) )
39+ . expect ( "Failed to serialize benchmark output." ) ;
3740
3841 println ! ( "{serialized_metrics}" ) ;
3942}
You can’t perform that action at this time.
0 commit comments