Method: Focuslight::SimpleGraph#initialize

Defined in:
lib/focuslight/graph.rb

#initialize(row) ⇒ SimpleGraph

Returns a new instance of SimpleGraph.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/focuslight/graph.rb', line 107

def initialize(row)
  super

  @mode = row[:mode] || 'gauge' # NOT NULL DEFAULT 'gauge'
  @color = row[:color] || '#00CC00' # NOT NULL DEFAULT '#00CC00'
  @ulimit = row[:ulimit] || 1000000000000000 # NOT NULL DEFAULT 1000000000000000
  @llimit = row[:llimit] || 0
  @type = row[:type] || 'AREA'

  @md5 = Digest::MD5.hexdigest(@id.to_s)

  @adjust = @parsed_meta.fetch(:adjust, '*')
  @adjustval = @parsed_meta.fetch(:adjustval, '1')
  @unit = @parsed_meta.fetch(:unit, '')
end