pub struct DistributedGraphRAGMetrics { /* private fields */ }Expand description
Thread-safe metrics tracker for distributed GraphRAG operations
Implementations§
Source§impl DistributedGraphRAGMetrics
impl DistributedGraphRAGMetrics
Sourcepub fn new(endpoints: &[EndpointConfig]) -> Self
pub fn new(endpoints: &[EndpointConfig]) -> Self
Create a new metrics tracker
Sourcepub async fn record_success(
&self,
endpoint_name: &str,
latency_ms: u64,
triple_count: usize,
)
pub async fn record_success( &self, endpoint_name: &str, latency_ms: u64, triple_count: usize, )
Record a successful query result for an endpoint
Sourcepub async fn record_failure(&self, endpoint_name: &str)
pub async fn record_failure(&self, endpoint_name: &str)
Record a failed query for an endpoint
Sourcepub async fn record_federation_query(
&self,
wall_latency_ms: u64,
total_triples: usize,
had_partial_failure: bool,
)
pub async fn record_federation_query( &self, wall_latency_ms: u64, total_triples: usize, had_partial_failure: bool, )
Record a completed federation query
Sourcepub async fn record_entity_resolution(&self)
pub async fn record_entity_resolution(&self)
Record an entity resolution operation
Sourcepub async fn endpoint_snapshot(&self, name: &str) -> Option<EndpointMetrics>
pub async fn endpoint_snapshot(&self, name: &str) -> Option<EndpointMetrics>
Retrieve a snapshot of metrics for a specific endpoint
Sourcepub async fn all_endpoint_snapshots(&self) -> Vec<EndpointMetrics>
pub async fn all_endpoint_snapshots(&self) -> Vec<EndpointMetrics>
Retrieve a snapshot of all endpoint metrics
Sourcepub async fn aggregate_snapshot(&self) -> AggregateMetrics
pub async fn aggregate_snapshot(&self) -> AggregateMetrics
Retrieve aggregate metrics
Sourcepub async fn fastest_endpoint(&self) -> Option<String>
pub async fn fastest_endpoint(&self) -> Option<String>
Return the endpoint name with the lowest average latency
Sourcepub async fn best_hit_rate_endpoint(&self) -> Option<String>
pub async fn best_hit_rate_endpoint(&self) -> Option<String>
Return the endpoint with the highest hit rate
Auto Trait Implementations§
impl Freeze for DistributedGraphRAGMetrics
impl !RefUnwindSafe for DistributedGraphRAGMetrics
impl Send for DistributedGraphRAGMetrics
impl Sync for DistributedGraphRAGMetrics
impl Unpin for DistributedGraphRAGMetrics
impl UnsafeUnpin for DistributedGraphRAGMetrics
impl !UnwindSafe for DistributedGraphRAGMetrics
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more