Class: Wavefront::Response::Graphite
- Includes:
- Mixins
- Defined in:
- lib/wavefront/response.rb
Instance Attribute Summary collapse
-
#graphite ⇒ Object
readonly
Returns the value of attribute graphite.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, options = {}) ⇒ Graphite
constructor
A new instance of Graphite.
Methods included from Mixins
Constructor Details
#initialize(response, options = {}) ⇒ Graphite
Returns a new instance of Graphite.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/wavefront/response.rb', line 58 def initialize(response, ={}) super [:prefix_length] ||= 1 # See also Wavefront::Client @graphite = Array.new self.timeseries.each do |ts| output_timeseries = Hash.new output_timeseries['target'] = interpolate_schema(ts['label'], ts['host'], [:prefix_length]) datapoints = Array.new ts['data'].each do |d| datapoints << [d[1], d[0]] end output_timeseries['datapoints'] = datapoints @graphite << output_timeseries end end |
Instance Attribute Details
#graphite ⇒ Object (readonly)
Returns the value of attribute graphite.
56 57 58 |
# File 'lib/wavefront/response.rb', line 56 def graphite @graphite end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
56 57 58 |
# File 'lib/wavefront/response.rb', line 56 def @options end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
56 57 58 |
# File 'lib/wavefront/response.rb', line 56 def response @response end |