diff --git a/node/sync/src/controllers/metrics.rs b/node/sync/src/controllers/metrics.rs index 4e6df22..b7026a9 100644 --- a/node/sync/src/controllers/metrics.rs +++ b/node/sync/src/controllers/metrics.rs @@ -6,5 +6,6 @@ lazy_static::lazy_static! { pub static ref SERIAL_SYNC_FILE_COMPLETED: Arc = register_timer("sync_controllers_serial_sync_file_completed"); pub static ref SERIAL_SYNC_CHUNKS_COMPLETED: Arc = register_timer("sync_controllers_serial_sync_chunks_completed"); pub static ref SERIAL_SYNC_SEGMENT_LATENCY: Arc = Sample::ExpDecay(0.015).register("sync_controllers_serial_sync_segment_latency", 1024); + pub static ref SERIAL_SYNC_SEGMENT_TIMEOUT: Arc> = CounterUsize::register("sync_controllers_serial_sync_segment_timeout"); pub static ref SERIAL_SYNC_UNEXPECTED_ERRORS: Arc> = CounterUsize::register("sync_controllers_serial_sync_unexpected_errors"); } diff --git a/node/sync/src/controllers/serial.rs b/node/sync/src/controllers/serial.rs index dd23e70..8bd8bcb 100644 --- a/node/sync/src/controllers/serial.rs +++ b/node/sync/src/controllers/serial.rs @@ -684,6 +684,7 @@ impl SerialSyncController { debug!(%self.tx_seq, "No peer to continue downloading and try to find other peers to download"); self.state = SyncState::Idle; } else if since.elapsed() >= self.config.peer_chunks_download_timeout { + metrics::SERIAL_SYNC_SEGMENT_TIMEOUT.inc(1); self.handle_response_failure(peer_id, "RPC timeout"); } else { completed = true;