Skip to main content

DataFlowMetrics

Struct DataFlowMetrics 

Source
pub struct DataFlowMetrics {
Show 16 fields pub pcie_generation: u8, pub pcie_width: u8, pub pcie_theoretical_gbps: f64, pub pcie_tx_gbps: f64, pub pcie_rx_gbps: f64, pub active_transfers: Vec<Transfer>, pub completed_transfers: VecDeque<Transfer>, pub memory_bus_utilization_pct: f64, pub memory_read_gbps: f64, pub memory_write_gbps: f64, pub pinned_memory_used_bytes: u64, pub pinned_memory_total_bytes: u64, pub staging_buffer_used_bytes: u64, pub pcie_tx_history: VecDeque<f64>, pub pcie_rx_history: VecDeque<f64>, pub memory_bus_history: VecDeque<f64>,
}
Expand description

Data flow and transfer metrics

Fields§

§pcie_generation: u8

PCIe generation (4, 5, etc.)

§pcie_width: u8

PCIe link width (x1, x4, x8, x16)

§pcie_theoretical_gbps: f64

Theoretical PCIe bandwidth in GB/s

§pcie_tx_gbps: f64

Current TX bandwidth in GB/s

§pcie_rx_gbps: f64

Current RX bandwidth in GB/s

§active_transfers: Vec<Transfer>

Currently active transfers

§completed_transfers: VecDeque<Transfer>

Recently completed transfers (last 100)

§memory_bus_utilization_pct: f64

GPU memory bus utilization percentage

§memory_read_gbps: f64

Memory read bandwidth in GB/s

§memory_write_gbps: f64

Memory write bandwidth in GB/s

§pinned_memory_used_bytes: u64

Pinned memory used in bytes

§pinned_memory_total_bytes: u64

Pinned memory total in bytes

§staging_buffer_used_bytes: u64

Staging buffer used in bytes

§pcie_tx_history: VecDeque<f64>

PCIe TX history

§pcie_rx_history: VecDeque<f64>

PCIe RX history

§memory_bus_history: VecDeque<f64>

Memory bus utilization history

Implementations§

Source§

impl DataFlowMetrics

Source

pub const MAX_HISTORY_POINTS: usize = 60

Maximum history points

Source

pub const MAX_COMPLETED_TRANSFERS: usize = 100

Maximum completed transfers to keep

Source

pub fn new() -> Self

Create new data flow metrics

Source

pub fn calculate_pcie_bandwidth(generation: u8, width: u8) -> f64

Calculate PCIe theoretical bandwidth based on generation and width

Source

pub fn set_pcie_config(&mut self, generation: u8, width: u8)

Set PCIe configuration

Source

pub fn pcie_tx_utilization_pct(&self) -> f64

Get PCIe TX utilization percentage

Source

pub fn pcie_rx_utilization_pct(&self) -> f64

Get PCIe RX utilization percentage

Source

pub fn start_transfer(&mut self, transfer: Transfer)

Start tracking a new transfer

Source

pub fn complete_transfer(&mut self, transfer_id: TransferId)

Complete a transfer and move to history

Source

pub fn update_history(&mut self)

Update history sparklines

Source

pub fn bytes_in_flight(&self) -> u64

Get total bytes currently being transferred

Source

pub fn pinned_memory_utilization_pct(&self) -> f64

Get pinned memory utilization percentage

Trait Implementations§

Source§

impl Clone for DataFlowMetrics

Source§

fn clone(&self) -> DataFlowMetrics

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DataFlowMetrics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DataFlowMetrics

Source§

fn default() -> Self

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.