pub struct ObjectMetric { /* private fields */ }
Expand description
An object metric.
Record structured data. The value must adhere to a predefined structure and is serialized into JSON.
Implementations§
Source§impl ObjectMetric
impl ObjectMetric
Sourcepub fn new(meta: CommonMetricData) -> Self
pub fn new(meta: CommonMetricData) -> Self
Creates a new object metric.
Sourcepub fn set(&self, value: JsonValue)
pub fn set(&self, value: JsonValue)
Sets to the specified structure.
No additional verification is done. The shape needs to be externally verified.
§Arguments
value
- the value to set.
Sourcepub fn set_string(&self, object: String)
pub fn set_string(&self, object: String)
Sets to the specified structure.
Parses the passed JSON string. If it can’t be parsed into a valid object it records an invalid value error.
Note: This does not check the structure. This needs to be done by the wrapper.
§Arguments
object
- JSON representation of the object to set.
Sourcepub fn record_schema_error(&self)
pub fn record_schema_error(&self)
Record an InvalidValue
error for this metric.
Only to be used by the RLB.
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. inner to the first value insend_in_pings
.
§Returns
The number of errors reported.
Trait Implementations§
Source§impl Clone for ObjectMetric
impl Clone for ObjectMetric
Source§fn clone(&self) -> ObjectMetric
fn clone(&self) -> ObjectMetric
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ObjectMetric
impl Debug for ObjectMetric
Source§impl<UT> LiftRef<UT> for ObjectMetric
impl<UT> LiftRef<UT> for ObjectMetric
type LiftType = Arc<ObjectMetric>
Source§impl<UT> LowerError<UT> for ObjectMetric
impl<UT> LowerError<UT> for ObjectMetric
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for ObjectMetric
impl<UT> LowerReturn<UT> for ObjectMetric
Source§type ReturnType = <Arc<ObjectMetric> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<ObjectMetric> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
Source§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl MallocSizeOf for ObjectMetric
impl MallocSizeOf for ObjectMetric
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl MetricType for ObjectMetric
impl MetricType for ObjectMetric
Source§fn with_name(&self, _name: String) -> Selfwhere
Self: Sized,
fn with_name(&self, _name: String) -> Selfwhere
Self: Sized,
Create a new metric from this with a new name.
Source§fn with_dynamic_label(&self, _label: DynamicLabelType) -> Selfwhere
Self: Sized,
fn with_dynamic_label(&self, _label: DynamicLabelType) -> Selfwhere
Self: Sized,
Create a new metric from this with a specific label.
Source§impl TestGetValue<Value> for ObjectMetric
impl TestGetValue<Value> for ObjectMetric
Source§impl<UT> TypeId<UT> for ObjectMetric
impl<UT> TypeId<UT> for ObjectMetric
Auto Trait Implementations§
impl Freeze for ObjectMetric
impl RefUnwindSafe for ObjectMetric
impl Send for ObjectMetric
impl Sync for ObjectMetric
impl Unpin for ObjectMetric
impl UnwindSafe for ObjectMetric
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
Mutably borrows from an owned value. Read more