GpuMemoryDashboard

Struct GpuMemoryDashboard 

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

GPU Memory Dashboard for monitoring and visualization.

Provides real-time GPU memory tracking with allocation history, per-kernel usage, and memory pressure alerts.

§Example

use ringkernel_core::observability::GpuMemoryDashboard;

let dashboard = GpuMemoryDashboard::new();

// Track an allocation
dashboard.track_allocation(
    1,
    "input_queue",
    65536,
    GpuMemoryType::QueueBuffer,
    0,
    Some("processor_kernel"),
);

// Get current stats
let stats = dashboard.get_device_stats(0);
println!("GPU 0 utilization: {:.1}%", stats.utilization());

// Generate Grafana panel JSON
let panel = dashboard.grafana_panel();

Implementations§

Source§

impl GpuMemoryDashboard

Source

pub fn new() -> Arc<Self>

Create a new GPU memory dashboard.

Source

pub fn with_thresholds(thresholds: GpuMemoryThresholds) -> Arc<Self>

Create with custom thresholds.

Source

pub fn track_allocation( &self, id: u64, name: impl Into<String>, size: usize, memory_type: GpuMemoryType, device_index: u32, kernel_id: Option<&str>, )

Track a new GPU memory allocation.

Source

pub fn next_allocation_id(&self) -> u64

Generate a new unique allocation ID.

Source

pub fn track_deallocation(&self, id: u64)

Track deallocation.

Source

pub fn mark_unused(&self, id: u64)

Mark an allocation as no longer in use (but not freed).

Source

pub fn register_device( &self, device_index: u32, name: impl Into<String>, total_memory: u64, )

Register a GPU device.

Source

pub fn update_device_stats( &self, device_index: u32, free_memory: u64, ringkernel_used: u64, )

Update device memory statistics.

Source

pub fn get_device_stats( &self, device_index: u32, ) -> Option<GpuDeviceMemoryStats>

Get device statistics.

Source

pub fn get_all_device_stats(&self) -> Vec<GpuDeviceMemoryStats>

Get all device statistics.

Source

pub fn get_allocations(&self) -> Vec<GpuMemoryAllocation>

Get all active allocations.

Source

pub fn get_kernel_allocations( &self, kernel_id: &str, ) -> Vec<GpuMemoryAllocation>

Get allocations for a specific kernel.

Source

pub fn total_allocated(&self) -> u64

Get total allocated memory.

Source

pub fn peak_allocated(&self) -> u64

Get peak allocated memory.

Source

pub fn allocation_count(&self) -> usize

Get allocation count.

Source

pub fn check_pressure(&self, device_index: u32) -> MemoryPressureLevel

Check memory pressure level for a device.

Source

pub fn grafana_panel(&self) -> GrafanaPanel

Generate Grafana dashboard panel for GPU memory.

Source

pub fn prometheus_metrics(&self) -> String

Generate Prometheus metrics for GPU memory.

Source

pub fn summary_report(&self) -> String

Generate a memory summary report.

Trait Implementations§

Source§

impl Default for GpuMemoryDashboard

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

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
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