@@ -128,8 +128,9 @@ pub fn new_rpc_call_timer(_full_path: &str, _origin: &str) -> NoOpTimer {
128
128
/// a given block. The block's timestamp is used to calculate the latency.
129
129
///
130
130
/// Call this right after broadcasting a BlockResponse
131
- #[ allow( unused_variables) ]
132
131
pub fn record_block_response_latency ( block : & NakamotoBlock ) {
132
+ #[ cfg( not( feature = "monitoring_prom" ) ) ]
133
+ let _ = block;
133
134
#[ cfg( feature = "monitoring_prom" ) ]
134
135
{
135
136
use clarity:: util:: get_epoch_time_ms;
@@ -143,8 +144,9 @@ pub fn record_block_response_latency(block: &NakamotoBlock) {
143
144
}
144
145
145
146
/// Record the time taken to validate a block, as reported by the Stacks node.
146
- #[ allow( unused_variables) ]
147
147
pub fn record_block_validation_latency ( latency_ms : u64 ) {
148
+ #[ cfg( not( feature = "monitoring_prom" ) ) ]
149
+ let _ = latency_ms;
148
150
#[ cfg( feature = "monitoring_prom" ) ]
149
151
prometheus:: SIGNER_BLOCK_VALIDATION_LATENCIES_HISTOGRAM
150
152
. with_label_values ( & [ ] )
@@ -153,14 +155,13 @@ pub fn record_block_validation_latency(latency_ms: u64) {
153
155
154
156
/// Start serving monitoring metrics.
155
157
/// This will only serve the metrics if the `monitoring_prom` feature is enabled.
156
- #[ allow( unused_variables) ]
157
158
pub fn start_serving_monitoring_metrics ( config : GlobalConfig ) -> Result < ( ) , String > {
158
159
#[ cfg( feature = "monitoring_prom" ) ]
159
160
{
160
161
if config. metrics_endpoint . is_none ( ) {
161
162
return Ok ( ( ) ) ;
162
163
}
163
- let thread = std:: thread:: Builder :: new ( )
164
+ let _ = std:: thread:: Builder :: new ( )
164
165
. name ( "signer_metrics" . to_string ( ) )
165
166
. spawn ( move || {
166
167
if let Err ( monitoring_err) = server:: MonitoringServer :: start ( & config) {
0 commit comments