Class: InfluxDB::PointValue
- Inherits:
-
Object
- Object
- InfluxDB::PointValue
- Defined in:
- lib/metrics/influx/point_value.rb
Overview
Convert data point to string using Line protocol
Instance Attribute Summary collapse
-
#series ⇒ Object
readonly
Returns the value of attribute series.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(data) ⇒ PointValue
constructor
A new instance of PointValue.
Constructor Details
#initialize(data) ⇒ PointValue
Returns a new instance of PointValue.
6 7 8 9 10 11 |
# File 'lib/metrics/influx/point_value.rb', line 6 def initialize(data) @series = escape data[:series], :measurement @values = escape_values data[:values] @tags = data[:tags] @timestamp = data[:timestamp] end |
Instance Attribute Details
#series ⇒ Object (readonly)
Returns the value of attribute series.
4 5 6 |
# File 'lib/metrics/influx/point_value.rb', line 4 def series @series end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
4 5 6 |
# File 'lib/metrics/influx/point_value.rb', line 4 def @tags end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
4 5 6 |
# File 'lib/metrics/influx/point_value.rb', line 4 def @timestamp end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
4 5 6 |
# File 'lib/metrics/influx/point_value.rb', line 4 def values @values end |
Instance Method Details
#dump ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/metrics/influx/point_value.rb', line 13 def dump dump = @series.dup dump << ",#{@tags}" if @tags dump << " #{@values}" dump << " #{@timestamp}" if @timestamp dump end |