phasedb v0.0.1 PhaseDB.Sample

Describes an individual data point for insertion of retrieval from a series.

Summary

Functions

Is this Sample a real data point or the result of interpolation?

Create a new sample from attrs

Return the received_at time of the sample

Return the recorded_at time of the sample

Return an individual tag from the sample

Return the tags from the sample

Return the value of the sample

Types

t :: %PhaseDB.Sample{actual: term, received_at: term, recorded_at: term, tags: term, value: term}

Functions

actual?(sample)

Specs

actual?(t) :: boolean

Is this Sample a real data point or the result of interpolation?

create(attrs)

Specs

create(Keyword.t) :: t

Create a new sample from attrs.

received_at(sample)

Specs

Return the received_at time of the sample.

recorded_at(sample)

Specs

recorded_at(t) :: PhaseDB.TimeHelpers.utc_usecs | nil

Return the recorded_at time of the sample.

tag(sample, name)

Specs

tag(t, atom) :: number | String.t

Return an individual tag from the sample.

tags(sample)

Specs

tags(t) :: Map.t

Return the tags from the sample.

value(sample)

Specs

value(t) :: number | nil

Return the value of the sample.