codetether_agent/rlm/oracle/storage/sync_stats.rs
1//! Aggregate counters produced by a bulk spool-to-remote sync.
2//!
3//! Returned by [`super::manager::OracleTraceStorage::sync_pending`]
4//! so callers can log progress or alert on failures.
5//!
6//! # Examples
7//!
8//! ```ignore
9//! let stats = storage.sync_pending().await?;
10//! println!("uploaded={} failed={}", stats.uploaded, stats.failed);
11//! ```
12
13use serde::{Deserialize, Serialize};
14
15/// Counters from a single sync pass over the local spool.
16///
17/// `retained` includes both intentionally-kept and
18/// failed-to-upload files. `pending_after` reflects the spool
19/// state after the pass completes.
20///
21/// # Examples
22///
23/// ```ignore
24/// let stats = OracleTraceSyncStats::default();
25/// assert_eq!(stats.uploaded, 0);
26/// ```
27#[derive(Debug, Clone, Serialize, Deserialize, Default)]
28pub struct OracleTraceSyncStats {
29 /// Files successfully uploaded and removed from spool.
30 pub uploaded: usize,
31 /// Files that remain in the spool after this pass.
32 pub retained: usize,
33 /// Files that could not be uploaded or deleted.
34 pub failed: usize,
35 /// Total pending spool files after the pass.
36 pub pending_after: usize,
37}