Struct glean_core::metrics::TextMetric
source · [−]pub struct TextMetric { /* private fields */ }
Expand description
A text metric.
Records a single long Unicode text,
used when the limits on String
are too low.
Text is length-limited to MAX_LENGTH_VALUE
bytes.
Implementations
sourceimpl TextMetric
impl TextMetric
sourcepub fn new(meta: CommonMetricData) -> Self
pub fn new(meta: CommonMetricData) -> Self
Creates a new text metric.
sourcepub fn test_get_value(&self, ping_name: Option<String>) -> Option<String>
pub fn test_get_value(&self, ping_name: Option<String>) -> Option<String>
Test-only API (exported for FFI purposes).
Gets the currently stored value as a string.
This doesn’t clear the stored value.
sourcepub fn test_get_num_recorded_errors(&self, error: ErrorType) -> i32
pub fn test_get_num_recorded_errors(&self, error: ErrorType) -> i32
Exported for test purposes.
Gets the number of recorded errors for the given metric and error type.
Arguments
error
- The type of errorping_name
- represents the optional name of the ping to retrieve the metric for. Defaults to the first value insend_in_pings
.
Returns
The number of errors reported.
Trait Implementations
sourceimpl Clone for TextMetric
impl Clone for TextMetric
sourcefn clone(&self) -> TextMetric
fn clone(&self) -> TextMetric
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TextMetric
impl Debug for TextMetric
sourceimpl MetricType for TextMetric
impl MetricType for TextMetric
sourcefn meta(&self) -> &CommonMetricData
fn meta(&self) -> &CommonMetricData
Access the stored metadata
sourcefn with_dynamic_label(&self, label: String) -> Self
fn with_dynamic_label(&self, label: String) -> Self
Create a new metric from this with a specific label.
sourcefn should_record(&self, glean: &Glean) -> bool
fn should_record(&self, glean: &Glean) -> bool
Whether this metric should currently be recorded Read more
Auto Trait Implementations
impl RefUnwindSafe for TextMetric
impl Send for TextMetric
impl Sync for TextMetric
impl Unpin for TextMetric
impl UnwindSafe for TextMetric
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more