Class: Linr::Encoder::Line

Inherits:
Object
  • Object
show all
Defined in:
lib/linr/encoder/line.rb

Overview

Encodes data entry into the InfluxDB line format.

Examples:

Encode a data series

Line.new.dump(Data.new(measurement: "series", fields: { a: 0.5 }))

See Also:

Instance Method Summary collapse

Instance Method Details

#dump(data) ⇒ String

Encodes data into the line syntax

Parameters:

Returns:

  • (String)

11
12
13
14
15
16
17
18
# File 'lib/linr/encoder/line.rb', line 11

def dump(data)
  [
    dump_measurement(data.measurement),
    dump_tags(data.tags),
    dump_fields(data.fields),
    dump_timestamp(data.timestamp)
  ].compact.join
end