Rust

metric

Module

[Metric]: one row read back, and the schema rows are written with.

Contents

use utopia_usage::metric::Attribute;
Rust
pub struct Attribute

One attribute of a table's schema.

use utopia_usage::metric::Index;
Rust
pub struct Index

One index of a table's schema.

use utopia_usage::Metric;
Rust
pub struct Metric

One usage metric read back: its attributes as the adapter returned them ($id, metric, value, time, type, tenant, dimension columns, grouped dimensions), with typed getters for the common ones.

Also implements From.
use utopia_usage::Kind;
Rust
pub enum Kind

Which table a metric lives in: additive events or point-in-time gauges.

use utopia_usage::Number;
Rust
pub enum Number

Undocumented.

Rust
pub type Columns = Vec<(&'static str, Option<Str>)>

The dimension columns of a row, as extracted from its tags: each of the kind's columns in order, None when absent or empty.

Rust
pub const EVENT_COLUMNS: &[&str] = &[ "path", "method", "status", "service", "resourceType", "resourceId", "resourceInternalId", "teamId", "teamInternalId", "country", "region", "hostname", "ip", "protocol", "accept", "acceptLanguage", "queryKeys", "ipReputation", "city", "continentCode", "subdivisions", "postalCode", "latitude", "longitude", "timeZone", "weatherCode", "isp", "autonomousSystemNumber", "autonomousSystemOrganization",

Event dimension columns, extracted from tags into dedicated columns.

Rust
pub const GAUGE_COLUMNS: &[&str] = &["service", "resourceType", "teamId", "teamInternalId", "resourceId", "resourceInternalId", "ordinal"]

Gauge dimension columns.