themis/internal/store

Types

pub type Store {
  Store(metrics: ets.Table, records: ets.Table)
}

Constructors

  • Store(metrics: ets.Table, records: ets.Table)
pub type StoreError {
  MetricNameAlreadyExists
  InsertError
  DecodeErrors(List(dynamic.DecodeError))
  TableError
  InvalidIncrement
  SingleResultExpected
  InvalidType
  MetricNotFound
}

Constructors

  • MetricNameAlreadyExists
  • InsertError
  • DecodeErrors(List(dynamic.DecodeError))
  • TableError
  • InvalidIncrement
  • SingleResultExpected
  • InvalidType
  • MetricNotFound

Functions

pub fn find_metric(
  store store: Store,
  name name: MetricName,
  kind given_kind: String,
) -> Result(#(String, String, List(Float)), StoreError)
pub fn find_record(
  store store: Store,
  metric_name name: MetricName,
  labels labels: LabelSet,
) -> Result(#(LabelSet, Number), StoreError)
pub fn increment_record(
  store store: Store,
  name name: MetricName,
  labels labels: LabelSet,
) -> Result(Nil, StoreError)
pub fn increment_record_by(
  store store: Store,
  name name: MetricName,
  labels labels: LabelSet,
  by value: Number,
) -> Result(Nil, StoreError)
pub fn init() -> Store
pub fn insert_record(
  store store: Store,
  name name: MetricName,
  labels labels: LabelSet,
  value value: Number,
) -> Result(Nil, StoreError)
pub fn match_metrics(
  store store: Store,
  kind kind: String,
) -> Result(List(#(String, String, List(Float))), StoreError)
pub fn match_records(
  store store: Store,
  metric_name name: MetricName,
) -> Result(Dict(LabelSet, Number), StoreError)
pub fn new_metric(
  store store: Store,
  name name: MetricName,
  description description: String,
  kind kind: String,
  buckets buckets: List(Float),
) -> Result(Nil, StoreError)
Search Document