upleb.uk

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

summaryrefslogtreecommitdiff
path: root/tests/common/sync_helpers.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-19 15:53:48 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-19 15:59:23 +0000
commit02a90c109d4d08c6a54184f821c100f4eba92545 (patch)
treea8c07978d5a7c58e2776cf057cc89e1233de1eee /tests/common/sync_helpers.rs
parent565715adf14cafd0f0155d553f583581334a8dac (diff)
Simplify sync metrics to track only newly saved events
Replace broken event counting that occurred before duplicate/policy checks with accurate tracking of events that are new, accepted, and saved. Changes: - Added ProcessResult enum to track event processing outcomes - Modified process_event_static() to return ProcessResult - Replaced events_total (with source labels) with events_synced_total - Removed gap_events_total and event_source module - Removed eose_received flag (EOSE is per-subscription, not suitable) - Updated all tests to use new simplified API The new ngit_sync_events_synced_total metric only counts events that: 1. Are new (not duplicates) 2. Pass write policy validation 3. Are successfully saved to database All 165 tests pass (124 lib + 41 integration)
Diffstat (limited to 'tests/common/sync_helpers.rs')
-rw-r--r--tests/common/sync_helpers.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/common/sync_helpers.rs b/tests/common/sync_helpers.rs
index 8971369..cccfbdd 100644
--- a/tests/common/sync_helpers.rs
+++ b/tests/common/sync_helpers.rs
@@ -698,9 +698,9 @@ impl ParsedMetrics {
698 698
699 // Convenience accessors for sync metrics 699 // Convenience accessors for sync metrics
700 700
701 /// Get total events synced from a specific source 701 /// Get total events synced (no source categorization)
702 pub fn events_total(&self, source: &str) -> Option<u64> { 702 pub fn events_synced_total(&self) -> Option<u64> {
703 self.counter("ngit_sync_events_total", &[("source", source)]) 703 self.counter("ngit_sync_events_synced_total", &[])
704 } 704 }
705 705
706 /// Check if a specific relay is connected 706 /// Check if a specific relay is connected