pub struct PartitionStats {
pub partition_id: u32,
pub event_count: u64,
pub total_latency_ns: u64,
pub write_count: u64,
pub min_latency_ns: u64,
pub max_latency_ns: u64,
pub error_count: u64,
}Expand description
Per-partition statistics for detecting hot partitions and skew
SierraDB uses 32 fixed partitions for single-node, 1024+ for clusters. This struct tracks metrics per partition to detect imbalances.
Fields§
§partition_id: u32Partition ID (0 to partition_count-1)
event_count: u64Total events written to this partition
total_latency_ns: u64Total write latency sum (nanoseconds) for calculating average
write_count: u64Number of writes for calculating average latency
min_latency_ns: u64Minimum write latency (nanoseconds)
max_latency_ns: u64Maximum write latency (nanoseconds)
error_count: u64Total error count for this partition
Implementations§
Source§impl PartitionStats
impl PartitionStats
Sourcepub fn avg_latency(&self) -> Option<Duration>
pub fn avg_latency(&self) -> Option<Duration>
Calculate average write latency
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PartitionStats
impl RefUnwindSafe for PartitionStats
impl Send for PartitionStats
impl Sync for PartitionStats
impl Unpin for PartitionStats
impl UnwindSafe for PartitionStats
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