Skip to main content

SyncProgress

Struct SyncProgress 

Source
pub struct SyncProgress {
Show 17 fields pub activities: StreamProgress, pub gpx: StreamProgress, pub health: StreamProgress, pub performance: StreamProgress, pub start_time: Instant, pub profile_name: Mutex<String>, pub date_range: Mutex<String>, pub latest_range: Mutex<Option<(String, String)>>, pub backfill_range: Mutex<Option<(String, String)>>, pub rate_history: Mutex<Vec<u32>>, pub total_requests: AtomicU32, pub errors: Mutex<Vec<ErrorEntry>>, pub storage_path: Mutex<String>, pub is_planning: AtomicBool, pub shutdown: AtomicBool, pub planning_step: Mutex<PlanningStep>, pub oldest_activity_date: Mutex<Option<String>>, /* private fields */
}
Expand description

Overall sync progress across all streams

Fields§

§activities: StreamProgress

Activities stream progress

§gpx: StreamProgress

GPX downloads progress

§health: StreamProgress

Health data progress

§performance: StreamProgress

Performance metrics progress

§start_time: Instant

Start time for ETA calculation

§profile_name: Mutex<String>

User profile name

§date_range: Mutex<String>

Date range being synced (legacy, kept for compatibility)

§latest_range: Mutex<Option<(String, String)>>

Latest sync date range (from -> to)

§backfill_range: Mutex<Option<(String, String)>>

Backfill date range (frontier -> target, syncing backwards)

§rate_history: Mutex<Vec<u32>>

Request rate history (last 60 seconds)

§total_requests: AtomicU32

Total requests made

§errors: Mutex<Vec<ErrorEntry>>

Error details for display

§storage_path: Mutex<String>

Storage path for display

§is_planning: AtomicBool

Whether we’re in planning phase

§shutdown: AtomicBool

Whether shutdown has been requested

§planning_step: Mutex<PlanningStep>

Current planning step

§oldest_activity_date: Mutex<Option<String>>

Oldest activity date found during planning

Implementations§

Source§

impl SyncProgress

Source

pub fn new() -> Self

Create new sync progress tracker

Source

pub fn set_planning_step(&self, step: PlanningStep)

Set planning step

Source

pub fn get_planning_step(&self) -> PlanningStep

Get current planning step

Source

pub fn finish_planning(&self)

Mark planning as complete

Source

pub fn is_planning(&self) -> bool

Check if still planning

Source

pub fn request_shutdown(&self)

Request that progress reporting shuts down

Source

pub fn should_shutdown(&self) -> bool

Check if shutdown has been requested

Source

pub fn set_oldest_activity_date(&self, date: &str)

Set oldest activity date found

Source

pub fn get_oldest_activity_date(&self) -> Option<String>

Get oldest activity date

Source

pub fn set_profile(&self, name: &str)

Set profile name

Source

pub fn get_profile(&self) -> String

Get profile name

Source

pub fn set_date_range(&self, from: &str, to: &str)

Set date range

Source

pub fn get_date_range(&self) -> String

Get date range

Source

pub fn set_sync_mode(&self, mode: SyncMode)

Set sync mode

Source

pub fn get_sync_mode(&self) -> SyncMode

Get sync mode

Source

pub fn set_latest_range(&self, from: &str, to: &str)

Set latest sync date range

Source

pub fn get_latest_range(&self) -> Option<(String, String)>

Get latest sync date range

Source

pub fn set_backfill_range(&self, frontier: &str, target: &str)

Set backfill date range (frontier -> target, syncing backwards)

Source

pub fn get_backfill_range(&self) -> Option<(String, String)>

Get backfill date range

Source

pub fn set_storage_path(&self, path: &str)

Set storage path

Source

pub fn get_storage_path(&self) -> String

Get storage path

Source

pub fn add_error(&self, stream: &'static str, item: String, error: String)

Add an error entry

Source

pub fn get_errors(&self) -> Vec<ErrorEntry>

Get all errors

Source

pub fn get_current_task(&self) -> Option<String>

Get current task description (finds first active stream)

Source

pub fn record_request(&self)

Record a request for rate tracking

Source

pub fn update_rate_history(&self)

Update rate history (call once per second)

Source

pub fn requests_per_minute(&self) -> u32

Get rate per minute (average over last minute)

Source

pub fn elapsed_str(&self) -> String

Get elapsed time as formatted string

Source

pub fn eta_str(&self) -> String

Estimate time remaining

Source

pub fn total_remaining(&self) -> u32

Get total items remaining across all streams

Source

pub fn total_completed(&self) -> u32

Get total completed across all streams

Source

pub fn total_failed(&self) -> u32

Get total failed across all streams

Source

pub fn is_complete(&self) -> bool

Check if all streams are complete

Source

pub fn print_simple_status(&self)

Print a status line for terminal progress reporting.

Trait Implementations§

Source§

impl Default for SyncProgress

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,