Instream v0.11.0 Instream.Series behaviour
Defines a series.
Usage
defmodule MySeries
use Instream.Series
series do
database "my_database"
measurement "cpu_load"
tag :host, default: "www"
tag :core
field :value, default: 100
field :value_desc
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{
fields: %MySeries.Fields{ value: 100, value_desc: nil },
tags: %MySeries.Tags{ host: "www", core: nil },
timestamp: nil
}
:timestamp
is expected to be a unix nanosecond timestamp.
Summary
Macros
Defines the database for the series
Defines a field in the series
Defines the measurement of the series
Defines the series
Defines a tag in the series
Callbacks
Provides metadata access for a series