Class: OracleFrasSizes
- Inherits:
-
Object
- Object
- OracleFrasSizes
- Includes:
- Graphs::AreaStackedChart, Mongoid::Attributes::Dynamic, Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/app/models/oracle_fras_sizes.rb
Class Method Summary collapse
- .all_fras_charts(options) ⇒ Object
-
.chart_data(options = {}) ⇒ Object
TODO - files chart.
- .fra_chart(path, values) ⇒ Object
- .graphs ⇒ Object
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() charts = [] OracleFrasSizes.where(:timestamp.gte => [:start]). where(:timestamp.lt => [:end]). where(:host_id => [:host_id]). where(:plugin_id => [: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( = {}) charts = [] charts = self.all_fras_charts() 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 |
.graphs ⇒ Object
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 |