pub struct RiGrafanaDashboardGenerator { /* private fields */ }Expand description
Grafana dashboard generator
Implementations§
Source§impl RiGrafanaDashboardGenerator
impl RiGrafanaDashboardGenerator
pub fn new() -> Self
Sourcepub fn create_dashboard(&self, title: &str) -> RiGrafanaDashboard
pub fn create_dashboard(&self, title: &str) -> RiGrafanaDashboard
Create a new dashboard with default settings
Sourcepub fn create_prometheus_target(
&self,
expr: &str,
ref_id: &str,
legend_format: Option<&str>,
) -> RiGrafanaTarget
pub fn create_prometheus_target( &self, expr: &str, ref_id: &str, legend_format: Option<&str>, ) -> RiGrafanaTarget
Create a Prometheus target
Sourcepub fn create_panel(
&mut self,
title: &str,
panel_type: &str,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_panel( &mut self, title: &str, panel_type: &str, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a new panel with default settings
Sourcepub fn create_request_rate_panel(
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_request_rate_panel( &mut self, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a graph panel for request rate
Sourcepub fn create_request_duration_panel(
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_request_duration_panel( &mut self, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a graph panel for request duration
Sourcepub fn create_active_connections_panel(
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_active_connections_panel( &mut self, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a stat panel for active connections
Sourcepub fn create_error_rate_panel(
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_error_rate_panel( &mut self, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a graph panel for error rate
Sourcepub fn create_cache_metrics_panel(
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_cache_metrics_panel( &mut self, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a graph panel for cache metrics
Sourcepub fn create_db_query_time_panel(
&mut self,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_db_query_time_panel( &mut self, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a graph panel for database query time
Sourcepub fn generate_default_dashboard(&mut self) -> RiResult<RiGrafanaDashboard>
pub fn generate_default_dashboard(&mut self) -> RiResult<RiGrafanaDashboard>
Generate a default Ri dashboard with common metrics panels
Sourcepub fn generate_auto_dashboard(
&mut self,
metrics: Vec<&str>,
dashboard_title: &str,
) -> RiResult<RiGrafanaDashboard>
pub fn generate_auto_dashboard( &mut self, metrics: Vec<&str>, dashboard_title: &str, ) -> RiResult<RiGrafanaDashboard>
Generate a dashboard automatically based on available metrics
This method analyzes available metrics and generates an appropriate dashboard with panels matching the metric types and values.
§Parameters
metrics: List of available metric namesdashboard_title: Title for the generated dashboard
§Returns
A Grafana dashboard automatically generated based on the provided metrics
Sourcepub fn create_counter_panel(
&mut self,
metric_name: &str,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_counter_panel( &mut self, metric_name: &str, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a counter panel for a metric
Sourcepub fn create_gauge_panel(
&mut self,
metric_name: &str,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_gauge_panel( &mut self, metric_name: &str, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a gauge panel for a metric
Sourcepub fn create_histogram_panel(
&mut self,
metric_name: &str,
x: i32,
y: i32,
w: i32,
h: i32,
) -> RiGrafanaPanel
pub fn create_histogram_panel( &mut self, metric_name: &str, x: i32, y: i32, w: i32, h: i32, ) -> RiGrafanaPanel
Create a histogram panel for a metric
Auto Trait Implementations§
impl Freeze for RiGrafanaDashboardGenerator
impl RefUnwindSafe for RiGrafanaDashboardGenerator
impl Send for RiGrafanaDashboardGenerator
impl Sync for RiGrafanaDashboardGenerator
impl Unpin for RiGrafanaDashboardGenerator
impl UnsafeUnpin for RiGrafanaDashboardGenerator
impl UnwindSafe for RiGrafanaDashboardGenerator
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request