Membrane.Telemetry.TimescaleDB.Model (Membrane Telemetry TimescaleDB v0.1.0) View Source

Module responsible for putting data to TimescaleDB.

Link to this section Summary

Link to this section Functions

Link to this function

add_all_measurements(arg)

View Source

Specs

add_all_measurements({list(), list(), list()}) ::
  {:ok, non_neg_integer(), map()}

Inserts all given measurements into a database as a batch.

Takes a tuple consisting of 3 lists:

  • with_paths - list of measurements with already present component_path_id replacing component_path
  • without_paths - list of measurements with unknown component_path_id but with a present component_path fields
  • paths_to_insert - list of components' paths that must be inserted to the database, the inserted records are then used to assign
                    `without_paths` their corresponding `path_id`s

Returns number of inserted records and a mapping of newly inserted paths {component_path => component_path_id}.

Link to this function

add_element_event(element)

View Source

Specs

add_element_event(map()) ::
  {:ok, Membrane.Telemetry.TimescaleDB.Model.Element.t()}
  | {:error, Ecto.Changeset.t()}

Specs

add_link(map()) ::
  {:ok, Membrane.Telemetry.TimescaleDB.Model.Link.t()}
  | {:error, Ecto.Changeset.t()}
Link to this function

add_measurement(measurement)

View Source

Specs

add_measurement(map()) ::
  {:ok, Membrane.Telemetry.TimescaleDB.Model.Measurement.t()}
  | {:error, Ecto.Changeset.t()}