pub struct MetricRecord {
pub metric_id: String,
pub timestamp: i64,
pub value_running_window_sum: f64,
pub value_running_window_avg: f64,
pub value_running_window_count: i64,
pub labels: BTreeMap<String, String>,
pub tenant_id: Option<String>,
}Expand description
A single metric record with running window calculations.
Schema v2 adds labels and tenant_id; both default to empty/None so
v1 producers and serialized records keep working unchanged.
Fields§
§metric_id: StringUnique identifier for the metric
timestamp: i64Unix timestamp in milliseconds
value_running_window_sum: f64Running sum within the window
value_running_window_avg: f64Running average within the window
value_running_window_count: i64Running count within the window
labels: BTreeMap<String, String>Metric labels; stored as a JSON object in the nullable labels column
tenant_id: Option<String>Tenant the row belongs to; None = node-global (no tenant)
Implementations§
Source§impl MetricRecord
impl MetricRecord
pub fn try_from_record_batch(batch: &RecordBatch) -> Result<Vec<Self>, Status>
Trait Implementations§
Source§impl Clone for MetricRecord
impl Clone for MetricRecord
Source§fn clone(&self) -> MetricRecord
fn clone(&self) -> MetricRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MetricRecord
impl Debug for MetricRecord
Source§impl Default for MetricRecord
impl Default for MetricRecord
Source§fn default() -> MetricRecord
fn default() -> MetricRecord
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MetricRecord
impl<'de> Deserialize<'de> for MetricRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MetricRecord
impl PartialEq for MetricRecord
Source§fn eq(&self, other: &MetricRecord) -> bool
fn eq(&self, other: &MetricRecord) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MetricRecord
impl Serialize for MetricRecord
impl StructuralPartialEq for MetricRecord
Auto Trait Implementations§
impl Freeze for MetricRecord
impl RefUnwindSafe for MetricRecord
impl Send for MetricRecord
impl Sync for MetricRecord
impl Unpin for MetricRecord
impl UnsafeUnpin for MetricRecord
impl UnwindSafe for MetricRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].