Record event processing for a specific tenant. Also increments the global `events_processed` counter and updates LSN/sequence tracking. Silently skips tenant tracking if the per-core tenant map is full (bounded to `MAX_TRACKED_TENANTS`).
(&self, lsn: u64, sequence: u64, tenant_id: u64)
| 86 | /// LSN/sequence tracking. Silently skips tenant tracking if the |
| 87 | /// per-core tenant map is full (bounded to `MAX_TRACKED_TENANTS`). |
| 88 | pub fn record_process_for_tenant(&self, lsn: u64, sequence: u64, tenant_id: u64) { |
| 89 | self.record_process(lsn, sequence); |
| 90 | |
| 91 | let mut map = match self.tenant_events.write() { |
| 92 | Ok(m) => m, |
| 93 | Err(p) => p.into_inner(), |
| 94 | }; |
| 95 | if let Some(count) = map.get_mut(&tenant_id) { |
| 96 | *count += 1; |
| 97 | } else if map.len() < MAX_TRACKED_TENANTS { |
| 98 | map.insert(tenant_id, 1); |
| 99 | } |
| 100 | // If map is full and tenant not present, silently skip. |
| 101 | } |
| 102 | |
| 103 | /// Snapshot of per-tenant event counts on this core. |
| 104 | pub fn tenant_event_counts(&self) -> HashMap<u64, u64> { |