Class: Wavefront::Response::Graphite
- Defined in:
- lib/wavefront/response.rb
Instance Attribute Summary collapse
-
#graphite ⇒ Object
readonly
Returns the value of attribute graphite.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ Graphite
constructor
A new instance of Graphite.
Constructor Details
#initialize(response) ⇒ Graphite
Returns a new instance of Graphite.
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/wavefront/response.rb', line 54 def initialize(response) super datapoints = Array.new self.timeseries.each do |ts| ts['data'].each do |d| datapoints << [d[1], d[0]] end end @graphite = [{ 'target' => self.query, 'datapoints' => datapoints }] end |
Instance Attribute Details
#graphite ⇒ Object (readonly)
Returns the value of attribute graphite.
52 53 54 |
# File 'lib/wavefront/response.rb', line 52 def graphite @graphite end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
52 53 54 |
# File 'lib/wavefront/response.rb', line 52 def response @response end |