pub struct LoggingMetrics {
pub entries_processed: Arc<AtomicU64>,
pub entries_published: Arc<AtomicU64>,
pub entries_failed: Arc<AtomicU64>,
pub entries_rate_limited: Arc<AtomicU64>,
pub entries_buffer_overflow: Arc<AtomicU64>,
pub bytes_published: Arc<AtomicU64>,
pub publish_attempts: Arc<AtomicU64>,
pub publish_retries: Arc<AtomicU64>,
pub buffer_size: Arc<AtomicU64>,
}Expand description
Metrics collector for logging infrastructure
Fields§
§entries_processed: Arc<AtomicU64>Total log entries processed
entries_published: Arc<AtomicU64>Total log entries published to NATS
entries_failed: Arc<AtomicU64>Total log entries that failed to publish
entries_rate_limited: Arc<AtomicU64>Total log entries dropped due to rate limiting
entries_buffer_overflow: Arc<AtomicU64>Total log entries dropped due to buffer overflow
bytes_published: Arc<AtomicU64>Total bytes published to NATS
publish_attempts: Arc<AtomicU64>Total publish attempts
publish_retries: Arc<AtomicU64>Total publish retries
buffer_size: Arc<AtomicU64>Current buffer size (approximate)
Implementations§
Source§impl LoggingMetrics
impl LoggingMetrics
Sourcepub fn inc_entries_processed(&self)
pub fn inc_entries_processed(&self)
Increment entries processed counter
Sourcepub fn inc_entries_published(&self)
pub fn inc_entries_published(&self)
Increment entries published counter
Sourcepub fn inc_entries_failed(&self)
pub fn inc_entries_failed(&self)
Increment entries failed counter
Sourcepub fn inc_entries_rate_limited(&self)
pub fn inc_entries_rate_limited(&self)
Increment entries rate limited counter
Sourcepub fn inc_entries_buffer_overflow(&self)
pub fn inc_entries_buffer_overflow(&self)
Increment entries buffer overflow counter
Sourcepub fn add_bytes_published(&self, bytes: u64)
pub fn add_bytes_published(&self, bytes: u64)
Add to bytes published counter
Sourcepub fn inc_publish_attempts(&self)
pub fn inc_publish_attempts(&self)
Increment publish attempts counter
Sourcepub fn inc_publish_retries(&self)
pub fn inc_publish_retries(&self)
Increment publish retries counter
Sourcepub fn set_buffer_size(&self, size: u64)
pub fn set_buffer_size(&self, size: u64)
Set current buffer size
Sourcepub fn get_entries_processed(&self) -> u64
pub fn get_entries_processed(&self) -> u64
Get entries processed count
Sourcepub fn get_entries_published(&self) -> u64
pub fn get_entries_published(&self) -> u64
Get entries published count
Sourcepub fn get_entries_failed(&self) -> u64
pub fn get_entries_failed(&self) -> u64
Get entries failed count
Sourcepub fn get_entries_rate_limited(&self) -> u64
pub fn get_entries_rate_limited(&self) -> u64
Get entries rate limited count
Sourcepub fn get_entries_buffer_overflow(&self) -> u64
pub fn get_entries_buffer_overflow(&self) -> u64
Get entries buffer overflow count
Sourcepub fn get_bytes_published(&self) -> u64
pub fn get_bytes_published(&self) -> u64
Get bytes published count
Sourcepub fn get_publish_attempts(&self) -> u64
pub fn get_publish_attempts(&self) -> u64
Get publish attempts count
Sourcepub fn get_publish_retries(&self) -> u64
pub fn get_publish_retries(&self) -> u64
Get publish retries count
Sourcepub fn get_buffer_size(&self) -> u64
pub fn get_buffer_size(&self) -> u64
Get current buffer size
Sourcepub fn get_success_rate(&self) -> f64
pub fn get_success_rate(&self) -> f64
Calculate success rate as percentage
Sourcepub fn get_avg_bytes_per_entry(&self) -> f64
pub fn get_avg_bytes_per_entry(&self) -> f64
Calculate average bytes per entry
Sourcepub fn get_summary(&self) -> LoggingMetricsSummary
pub fn get_summary(&self) -> LoggingMetricsSummary
Get summary statistics
Trait Implementations§
Source§impl Clone for LoggingMetrics
impl Clone for LoggingMetrics
Source§fn clone(&self) -> LoggingMetrics
fn clone(&self) -> LoggingMetrics
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoggingMetrics
impl Debug for LoggingMetrics
Auto Trait Implementations§
impl Freeze for LoggingMetrics
impl RefUnwindSafe for LoggingMetrics
impl Send for LoggingMetrics
impl Sync for LoggingMetrics
impl Unpin for LoggingMetrics
impl UnsafeUnpin for LoggingMetrics
impl UnwindSafe for LoggingMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);