pub struct MetricSeries {
pub series_id: u64,
pub category: MetricCategory,
pub name: String,
pub target: String,
pub static_tags: StaticTags,
pub description: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Metric series (dimension table).
Stores static metadata that identifies a unique metric series.
The series_id is computed as xxhash64 of (category, name, target, sorted_static_tags).
§Deduplication
Series are deduplicated using INSERT OR REPLACE on series_id.
When a duplicate series is inserted, only updated_at and description are refreshed.
Fields§
§series_id: u64Unique identifier: xxhash64(category|name|target|sorted_static_tags).
category: MetricCategoryMetric category.
name: StringMetric name (e.g., “latency”, “price”).
target: StringTarget identifier (e.g., “127.0.0.1:6379”, “BTC/USD”).
Static tags for identity (e.g., {“host”: “prod-1”, “region”: “us-west”}).
description: Option<String>Human-readable description.
created_at: DateTime<Utc>First seen timestamp.
updated_at: DateTime<Utc>Last updated timestamp.
Implementations§
Source§impl MetricSeries
impl MetricSeries
Sourcepub fn compute_series_id(
category: MetricCategory,
name: &str,
target: &str,
static_tags: &StaticTags,
) -> u64
pub fn compute_series_id( category: MetricCategory, name: &str, target: &str, static_tags: &StaticTags, ) -> u64
Compute series_id from category, name, target, and static_tags.
Formula: xxhash64(“category|name|target|k1=v1,k2=v2,…”) Tags are sorted by key for consistent hashing.
Sourcepub fn new(
category: MetricCategory,
name: impl Into<String>,
target: impl Into<String>,
static_tags: StaticTags,
description: Option<String>,
) -> Self
pub fn new( category: MetricCategory, name: impl Into<String>, target: impl Into<String>, static_tags: StaticTags, description: Option<String>, ) -> Self
Create a new MetricSeries with computed series_id.
Trait Implementations§
Source§impl Clone for MetricSeries
impl Clone for MetricSeries
Source§fn clone(&self) -> MetricSeries
fn clone(&self) -> MetricSeries
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MetricSeries
impl Debug for MetricSeries
Source§impl<'de> Deserialize<'de> for MetricSeries
impl<'de> Deserialize<'de> for MetricSeries
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>,
Auto Trait Implementations§
impl Freeze for MetricSeries
impl RefUnwindSafe for MetricSeries
impl Send for MetricSeries
impl Sync for MetricSeries
impl Unpin for MetricSeries
impl UnwindSafe for MetricSeries
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more