Trait glean_core::traits::Quantity

source ·
pub trait Quantity: TestGetValue<i64> {
    // Required methods
    fn set(&self, value: i64);
    fn test_get_num_recorded_errors(&self, error: ErrorType) -> i32;
}
Expand description

A description for the QuantityMetric type.

When changing this trait, make sure all the operations are implemented in the related type in ../metrics/.

Required Methods§

source

fn set(&self, value: i64)

Sets the value. Must be non-negative.

§Arguments
  • value - The value. Must be non-negative.
§Notes

Logs an error if the value is negative.

source

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 error
§Returns

The number of errors reported.

Implementors§