@@ -55,6 +55,7 @@ struct SutInstruments {
5555 disk_write_ops : Counter < u64 > ,
5656 ingestion_rows_total : Gauge < u64 > ,
5757 ingestion_bytes_total : Gauge < u64 > ,
58+ ingestion_rows_per_sec : Gauge < f64 > ,
5859}
5960
6061fn run_metric_attributes ( common_args : & CommonArgs , run_id : uuid:: Uuid ) -> Vec < KeyValue > {
@@ -141,15 +142,17 @@ fn record_sut_metrics(
141142 // Use adapter-provided rows_per_sec if available; otherwise derive it
142143 // from the delta in rows_ingested since the last scrape.
143144 if let Some ( v) = response. ingestion . rows_per_sec {
144- crate :: metrics :: INGESTION_ROWS_PER_SEC . record ( v, attributes) ;
145+ instruments . ingestion_rows_per_sec . record ( v, attributes) ;
145146 } else if let Some ( current_rows) = response. ingestion . rows_ingested
146147 && let Some ( prev_rows) = * prev_rows_ingested
147148 && let Some ( prev_time) = * last_scrape_time
148149 {
149150 let elapsed_secs = prev_time. elapsed ( ) . as_secs_f64 ( ) ;
150151 if elapsed_secs > 0.0 {
151152 let rows_per_sec = current_rows. saturating_sub ( prev_rows) as f64 / elapsed_secs;
152- crate :: metrics:: INGESTION_ROWS_PER_SEC . record ( rows_per_sec, attributes) ;
153+ instruments
154+ . ingestion_rows_per_sec
155+ . record ( rows_per_sec, attributes) ;
153156 }
154157 }
155158 // Update tracking state for the next scrape
@@ -654,6 +657,7 @@ pub(crate) async fn run(
654657 disk_write_ops : m. u64_counter ( "sut_disk_write_ops" ) . build ( ) ,
655658 ingestion_rows_total : m. u64_gauge ( "ingestion_rows_total" ) . build ( ) ,
656659 ingestion_bytes_total : m. u64_gauge ( "ingestion_bytes_total" ) . build ( ) ,
660+ ingestion_rows_per_sec : m. f64_gauge ( "ingestion_rows_per_sec" ) . build ( ) ,
657661 } ;
658662 let sut_attributes = Arc :: new ( std:: sync:: RwLock :: new ( metric_attributes. clone ( ) ) ) ;
659663 println ! ( "SUT metrics scraping enabled (run_id={run_id})" ) ;
0 commit comments