V2WALMetrics

Struct V2WALMetrics 

Source
pub struct V2WALMetrics { /* private fields */ }
Expand description

V2 WAL performance metrics collection specifically for graph operations.

This is the main metrics collector that coordinates all performance monitoring for V2 clustered edge graph operations, providing comprehensive tracking of throughput, latency, and resource utilization.

§Examples

use crate::backend::native::v2::wal::metrics::core::V2WALMetrics;

let metrics = V2WALMetrics::new();
metrics.record_write_operation(100, 50, Some(42), "edge_insert");
let counters = metrics.get_counters();
assert_eq!(counters.records_processed, 1);

Implementations§

Source§

impl V2WALMetrics

Source

pub fn new() -> Self

Create new metrics collector for V2 WAL graph operations.

Initializes all metric tracking components with default values and prepares the collector for comprehensive performance monitoring.

§Returns

A new V2WALMetrics instance ready to collect performance data.

§Examples
use crate::backend::native::v2::wal::metrics::core::V2WALMetrics;

let metrics = V2WALMetrics::new();
// Ready to collect metrics
Source

pub fn get_counters(&self) -> WALPerformanceCounters

Get current performance counters.

Returns a snapshot of all current performance metrics including operation counts, latencies, and resource utilization.

§Returns

A clone of the current WALPerformanceCounters.

Source

pub fn get_latency_histogram(&self) -> LatencyHistogram

Get current latency histogram.

Returns the current latency distribution data for all operation types, including write, read, flush, and checkpoint operations.

§Returns

A clone of the current LatencyHistogram.

Source

pub fn get_throughput_tracker(&self) -> ThroughputTracker

Get current throughput metrics.

Returns time-windowed throughput data including records per second, bytes per second, and transactions per second.

§Returns

A clone of the current ThroughputTracker.

Source

pub fn get_resource_tracker(&self) -> ResourceTracker

Get current resource utilization.

Returns current resource usage metrics including memory, CPU, disk I/O, and other system-level performance indicators.

§Returns

A clone of the current ResourceTracker.

Source

pub fn get_cluster_metrics(&self) -> ClusterPerformanceMetrics

Get cluster performance metrics.

Returns detailed performance metrics for individual clusters including access patterns, efficiency scores, and utilization data.

§Returns

A clone of the current ClusterPerformanceMetrics.

Source

pub fn get_error_tracker(&self) -> ErrorTracker

Get error tracker data.

Returns current error tracking data including error counts, rates, and recent error entries for analysis.

§Returns

A clone of the current ErrorTracker.

Source

pub fn get_global_counters(&self) -> (u64, u64, u64, u64, usize)

Get global counter values.

Returns the current values of all global atomic counters in a single atomic operation for consistency.

§Returns

A tuple containing (records_written, records_read, bytes_written, bytes_read, active_operations).

Source

pub fn reset(&self)

Reset all metrics.

Clears all metric data and resets all counters to their initial state. This is typically used for starting fresh measurements or clearing accumulated data.

Source§

impl V2WALMetrics

Source

pub fn record_write_operation( &self, record_size_bytes: usize, latency_us: u64, cluster_key: Option<i64>, operation_type: &str, )

Record a write operation for V2 graph operations.

This method captures comprehensive performance data for write operations including latency, size, cluster affinity, and operation type. It updates all relevant metrics components in a coordinated manner.

§Arguments
  • record_size_bytes - Size of the record being written in bytes
  • latency_us - Operation latency in microseconds
  • cluster_key - Optional cluster ID for cluster-affinity tracking
  • operation_type - Type of operation (e.g., “edge_insert”, “node_update”)
§Examples
use crate::backend::native::v2::wal::metrics::core::V2WALMetrics;

let metrics = V2WALMetrics::new();
metrics.record_write_operation(100, 50, Some(42), "edge_insert");
Source

pub fn record_read_operation( &self, record_size_bytes: usize, latency_us: u64, cluster_key: Option<i64>, operation_type: &str, )

Record a read operation for V2 graph operations.

Captures comprehensive performance data for read operations similar to write operations but optimized for read-specific metrics and patterns.

§Arguments
  • record_size_bytes - Size of the record being read in bytes
  • latency_us - Operation latency in microseconds
  • cluster_key - Optional cluster ID for cluster-affinity tracking
  • operation_type - Type of operation (e.g., “edge_read”, “node_lookup”)
§Examples
use crate::backend::native::v2::wal::metrics::core::V2WALMetrics;

let metrics = V2WALMetrics::new();
metrics.record_read_operation(150, 30, Some(42), "edge_read");
Source

pub fn record_error( &self, error_type: &str, message: &str, operation_context: &str, recovery_action: &str, )

Record an error occurrence.

Captures detailed error information for analysis and monitoring. This method tracks error patterns, frequencies, and recovery actions to help identify systematic issues and performance bottlenecks.

§Arguments
  • error_type - Type or category of the error
  • message - Detailed error message
  • operation_context - Context in which the error occurred
  • recovery_action - Action taken to recover from the error
§Examples
use crate::backend::native::v2::wal::metrics::core::V2WALMetrics;

let metrics = V2WALMetrics::new();
metrics.record_error(
    "IOError",
    "Disk write failed",
    "edge_insertion",
    "retry_operation"
);

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, 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, 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