Class: OracleFrasSizes

Inherits:
Object
  • Object
show all
Includes:
Graphs::AreaStackedChart, Mongoid::Attributes::Dynamic, Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/app/models/oracle_fras_sizes.rb

Class Method Summary collapse

Class Method Details

.all_fras_charts(options) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/app/models/oracle_fras_sizes.rb', line 16

def self.all_fras_charts(options)
  charts = []
  OracleFrasSizes.where(:timestamp.gte => options[:start]).
                  where(:timestamp.lt => options[:end]).
    where(:host_id => options[:host_id]).
    where(:plugin_id => options[:plugin_id]).
    order_by(timestamp: :asc).group_by{|u| u.path}.each_pair do |path, values|
    charts << self.fra_chart(path, values)
  end
  return charts
end

.chart_data(options = {}) ⇒ Object

TODO - files chart



10
11
12
13
14
# File 'lib/app/models/oracle_fras_sizes.rb', line 10

def self.chart_data(options = {})
  charts = []
  charts = self.all_fras_charts(options)
  return charts
end

.fra_chart(path, values) ⇒ Object



28
29
30
31
32
33
# File 'lib/app/models/oracle_fras_sizes.rb', line 28

def self.fra_chart(path, values)
  chart = self.chart_structure({:title => "Flash Recovery Area #{path} space usage", :value_axis => { :title => "FRA space usage"}})
  chart[:graph_data] = values

  return chart
end

.graphsObject



35
36
37
38
39
40
# File 'lib/app/models/oracle_fras_sizes.rb', line 35

def self.graphs
  {
    :used => { :line_color => '#FF0000' },
    :free => {:line_color => '#00FF00' }
  }
end