Skip to main content

SloTracker

Struct SloTracker 

Source
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

Source

pub fn new(config: SloConfig) -> SloTracker

Create a new SLO tracker with the given configuration.

§Arguments
  • config - SLO configuration
§Returns

A new SLO tracker instance.

§Examples
use perl_workspace_index_slo::{SloConfig, SloTracker};

let config = SloConfig::default();
let tracker = SloTracker::new(config);
Source

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);
Source

pub fn record_operation(&self, start: Instant, result: OperationResult)

Record the completion of an operation.

§Arguments
  • start - Timestamp returned from start_operation
  • result - 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);
Source

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 operation
  • start - Timestamp returned from start_operation
  • result - 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);
Source

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);
Source

pub fn all_statistics(&self) -> HashMap<OperationType, SloStatistics>

Get SLO statistics for all operation types.

§Returns

A map of operation type to SLO statistics.

§Examples
use perl_workspace_index_slo::SloTracker;

let tracker = SloTracker::default();
let all_stats = tracker.all_statistics();
Source

pub fn all_slos_met(&self) -> bool

Check if all SLOs are being met.

§Returns

true if all operation types are meeting their SLOs, false otherwise.

§Examples
use perl_workspace_index_slo::SloTracker;

let tracker = SloTracker::default();
let all_met = tracker.all_slos_met();
Source

pub fn config(&self) -> &SloConfig

Get the SLO configuration.

§Returns

The SLO configuration.

Source

pub fn reset(&self)

Reset all statistics.

§Examples
use perl_workspace_index_slo::SloTracker;

let tracker = SloTracker::default();
tracker.reset();

Trait Implementations§

Source§

impl Default for SloTracker

Source§

fn default() -> SloTracker

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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<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