pub struct SloTracker { /* private fields */ }Expand description
Workspace indexing and refactoring orchestration. SLO tracker for workspace index operations.
Tracks latency and success/failure for all operation types, providing SLO compliance monitoring and reporting.
Implementations§
Source§impl SloTracker
impl SloTracker
Sourcepub fn new(config: SloConfig) -> SloTracker
pub fn new(config: SloConfig) -> SloTracker
Sourcepub fn start_operation(&self, _operation_type: OperationType) -> Instant
pub fn start_operation(&self, _operation_type: OperationType) -> Instant
Start tracking an operation.
§Arguments
operation_type- Type of operation to track
§Returns
A timestamp that should be passed to record_operation.
§Examples
use perl_workspace_index_slo::{OperationResult, OperationType, SloTracker};
let tracker = SloTracker::default();
let start = tracker.start_operation(OperationType::DefinitionLookup);
// ... perform operation ...
tracker.record_operation(start, OperationResult::Success);Sourcepub fn record_operation(&self, start: Instant, result: OperationResult)
pub fn record_operation(&self, start: Instant, result: OperationResult)
Record the completion of an operation.
§Arguments
start- Timestamp returned fromstart_operationresult- Operation result (success or failure)
§Examples
use perl_workspace_index_slo::{SloTracker, OperationType, OperationResult};
let tracker = SloTracker::default();
let start = tracker.start_operation(OperationType::DefinitionLookup);
// ... perform operation ...
tracker.record_operation(start, OperationResult::Success);Sourcepub fn record_operation_type(
&self,
operation_type: OperationType,
start: Instant,
result: OperationResult,
)
pub fn record_operation_type( &self, operation_type: OperationType, start: Instant, result: OperationResult, )
Record the completion of a specific operation type.
§Arguments
operation_type- Type of operationstart- Timestamp returned fromstart_operationresult- Operation result
§Examples
use perl_workspace_index_slo::{SloTracker, OperationType, OperationResult};
let tracker = SloTracker::default();
let start = tracker.start_operation(OperationType::DefinitionLookup);
// ... perform operation ...
tracker.record_operation_type(OperationType::DefinitionLookup, start, OperationResult::Success);Sourcepub fn statistics(&self, operation_type: OperationType) -> SloStatistics
pub fn statistics(&self, operation_type: OperationType) -> SloStatistics
Get SLO statistics for a specific operation type.
§Arguments
operation_type- Type of operation
§Returns
SLO statistics for the operation type.
§Examples
use perl_workspace_index_slo::{SloTracker, OperationType};
let tracker = SloTracker::default();
let stats = tracker.statistics(OperationType::DefinitionLookup);Sourcepub fn all_statistics(&self) -> HashMap<OperationType, SloStatistics>
pub fn all_statistics(&self) -> HashMap<OperationType, SloStatistics>
Sourcepub fn all_slos_met(&self) -> bool
pub fn all_slos_met(&self) -> bool
Trait Implementations§
Source§impl Default for SloTracker
impl Default for SloTracker
Source§fn default() -> SloTracker
fn default() -> SloTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SloTracker
impl !RefUnwindSafe for SloTracker
impl Send for SloTracker
impl Sync for SloTracker
impl Unpin for SloTracker
impl UnsafeUnpin for SloTracker
impl !UnwindSafe for SloTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more