@@ -3,16 +3,23 @@ use crate::prelude::{Gauge, Histogram, HostMetrics, MetricsRegistry};
33use std:: collections:: HashMap ;
44use std:: sync:: Arc ;
55
6+ use super :: stopwatch:: StopwatchMetrics ;
7+
68pub struct SubgraphInstanceMetrics {
79 pub block_trigger_count : Box < Histogram > ,
810 pub block_processing_duration : Box < Histogram > ,
911 pub block_ops_transaction_duration : Box < Histogram > ,
1012
13+ pub stopwatch : StopwatchMetrics ,
1114 trigger_processing_duration : Box < Histogram > ,
1215}
1316
1417impl SubgraphInstanceMetrics {
15- pub fn new ( registry : Arc < dyn MetricsRegistry > , subgraph_hash : & str ) -> Self {
18+ pub fn new (
19+ registry : Arc < dyn MetricsRegistry > ,
20+ subgraph_hash : & str ,
21+ stopwatch : StopwatchMetrics ,
22+ ) -> Self {
1623 let block_trigger_count = registry
1724 . new_deployment_histogram (
1825 "deployment_block_trigger_count" ,
@@ -51,6 +58,7 @@ impl SubgraphInstanceMetrics {
5158 block_processing_duration,
5259 trigger_processing_duration,
5360 block_ops_transaction_duration,
61+ stopwatch,
5462 }
5563 }
5664
0 commit comments