Class: InfluxDB2::FluxRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/influxdb2/client/flux_table.rb

Overview

A record is a tuple of values. Each record in the table represents a single point in the series. Ref: bit.ly/flux-spec#record

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, values: nil, row: nil) ⇒ FluxRecord

Returns a new instance of FluxRecord.

Parameters:

  • table (Integer)

    the index of table which contains the record

  • values (Hash) (defaults to: nil)

    tuple of values

  • row (Array) (defaults to: nil)

    record columns



51
52
53
54
55
# File 'lib/influxdb2/client/flux_table.rb', line 51

def initialize(table, values: nil, row: nil)
  @table = table
  @values = values || {}
  @row = row || []
end

Instance Attribute Details

#rowObject (readonly)

Returns the value of attribute row.



57
58
59
# File 'lib/influxdb2/client/flux_table.rb', line 57

def row
  @row
end

#tableObject

Returns the value of attribute table.



57
58
59
# File 'lib/influxdb2/client/flux_table.rb', line 57

def table
  @table
end

#valuesObject (readonly)

Returns the value of attribute values.



57
58
59
# File 'lib/influxdb2/client/flux_table.rb', line 57

def values
  @values
end

Instance Method Details

#fieldString

Returns value with key “_field”.

Returns:

  • (String)

    value with key “_field”



81
82
83
# File 'lib/influxdb2/client/flux_table.rb', line 81

def field
  values['_field']
end

#measurementString

Returns value with key “_measurement”.

Returns:

  • (String)

    value with key “_measurement”



86
87
88
# File 'lib/influxdb2/client/flux_table.rb', line 86

def measurement
  values['_measurement']
end

#startTime

Returns the inclusive lower time bound of all records.

Returns:

  • (Time)

    the inclusive lower time bound of all records



61
62
63
# File 'lib/influxdb2/client/flux_table.rb', line 61

def start
  values['_start']
end

#stopTime

Returns the exclusive upper time bound of all records.

Returns:

  • (Time)

    the exclusive upper time bound of all records



66
67
68
# File 'lib/influxdb2/client/flux_table.rb', line 66

def stop
  values['_stop']
end

#timeTime

Returns the time of the record.

Returns:

  • (Time)

    the time of the record



71
72
73
# File 'lib/influxdb2/client/flux_table.rb', line 71

def time
  values['_time']
end

#valueObject

Returns the value of the record.

Returns:

  • (Object)

    the value of the record



76
77
78
# File 'lib/influxdb2/client/flux_table.rb', line 76

def value
  values['_value']
end