Class: CollectdPlot::PlotProperties

Inherits:
Object
  • Object
show all
Defined in:
lib/collectd-plot/plot_properties.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ PlotProperties

Returns a new instance of PlotProperties.



11
12
13
14
15
16
17
18
# File 'lib/collectd-plot/plot_properties.rb', line 11

def initialize(params = {})
  self.host = params[:host] or raise ("no host")
  self.metric = params[:metric] or raise ("no metric")
  self.instance = params[:instance]
  self.start = params[:start] || (Time.now.to_i - 86400)
  self.finish = params[:finish] || Time.now.to_i
  self.instance = params[:instance] || "TODO"
end

Instance Attribute Details

#finishObject

Returns the value of attribute finish.



8
9
10
# File 'lib/collectd-plot/plot_properties.rb', line 8

def finish
  @finish
end

#hostObject

may be a glob



5
6
7
# File 'lib/collectd-plot/plot_properties.rb', line 5

def host
  @host
end

#instanceObject

Returns the value of attribute instance.



9
10
11
# File 'lib/collectd-plot/plot_properties.rb', line 9

def instance
  @instance
end

#metricObject

Returns the value of attribute metric.



6
7
8
# File 'lib/collectd-plot/plot_properties.rb', line 6

def metric
  @metric
end

#startObject

Returns the value of attribute start.



7
8
9
# File 'lib/collectd-plot/plot_properties.rb', line 7

def start
  @start
end