Instream.Series behaviour

Defines a series.

Usage

defmodule MySeries
  use Instream.Series

  series do
    database    :my_database
    measurement :cpu_load

    tag :host
    tag :core

    field :value
  end
end

Metadata

The metadata of a series (i.e. the measurement) can be retrieved using the __meta__/1 method.

Struct

Every series will be registered as a struct. Following the above usage example you will get the following struct:

%MySeries{
    database:    "my_database",
    measurement: "cpu_load",
    fields:      %MySeries.Fields{ value: nil },
    tags:        %MySeries.Tags{ host: nil, core: nil }
}
Source

Summary

database(name)

Defines the database for the series

field(name)

Defines a field in the series

measurement(name)

Defines the measurement of the series

series(list)

Defines the series

tag(name)

Defines a tag in the series

Macros

database(name)

Defines the database for the series.

Source
field(name)

Defines a field in the series.

Source
measurement(name)

Defines the measurement of the series.

Source
series(list)

Defines the series.

Source
tag(name)

Defines a tag in the series.

Source

Callbacks

__meta__/1

Specs:

  • __meta__(atom) :: any

Provides metadata access for a series.

Available information

  • :database - the database where the series is stored
  • :fields - the fields in the series
  • :measurement - the measurement of the series
  • :tags - the available tags defining the series
Source