upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sync/metrics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync/metrics.rs')
-rw-r--r--src/sync/metrics.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sync/metrics.rs b/src/sync/metrics.rs
index 411ff63..d917dc0 100644
--- a/src/sync/metrics.rs
+++ b/src/sync/metrics.rs
@@ -207,7 +207,9 @@ impl SyncMetrics {
207 HealthState::Degraded => 2, 207 HealthState::Degraded => 2,
208 HealthState::Dead => 3, 208 HealthState::Dead => 3,
209 }; 209 };
210 self.relay_status.with_label_values(&[relay]).set(state_value); 210 self.relay_status
211 .with_label_values(&[relay])
212 .set(state_value);
211 } 213 }
212 214
213 /// Record relay failure count. 215 /// Record relay failure count.
@@ -259,9 +261,7 @@ impl SyncMetrics {
259 /// * `source` - The event source type (see [`record_event`](Self::record_event)) 261 /// * `source` - The event source type (see [`record_event`](Self::record_event))
260 /// * `count` - Number of events to record 262 /// * `count` - Number of events to record
261 pub fn record_events(&self, source: &str, count: u64) { 263 pub fn record_events(&self, source: &str, count: u64) {
262 self.events_total 264 self.events_total.with_label_values(&[source]).inc_by(count);
263 .with_label_values(&[source])
264 .inc_by(count);
265 } 265 }
266 266
267 /// Record a gap event filled during catchup. 267 /// Record a gap event filled during catchup.
@@ -451,4 +451,4 @@ mod tests {
451 let metrics2 = SyncMetrics::register(&registry); 451 let metrics2 = SyncMetrics::register(&registry);
452 assert!(metrics2.is_err()); 452 assert!(metrics2.is_err());
453 } 453 }
454} \ No newline at end of file 454}