Class: Bsdnet::CurrentEntries
- Inherits:
-
Object
- Object
- Bsdnet::CurrentEntries
- Includes:
- Graphs::AreaNotStackedChart, Mongoid::Attributes::Dynamic, Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/app/models/bsdnet/current_entries.rb
Class Method Summary collapse
Class Method Details
.chart_data(options = {}) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/app/models/bsdnet/current_entries.rb', line 10 def self.chart_data( = {}) charts = [] [:interface] = 'vlan254' charts << self.entries_chart() return charts end |
.entries_chart(options) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/app/models/bsdnet/current_entries.rb', line 17 def self.entries_chart() chart = self.chart_structure({:title => "Network current entries", :value_axis => { :title => "Network entries []"}}) values = Bsdnet::CurrentEntries.where(:timestamp.gte => [:start]). where(:timestamp.lt => [:end]). where(:host_id => [:host_id]). where(:plugin_id => [:plugin_id]). order(timestamp: :asc) chart[:graph_data] = values chart end |
.graphs ⇒ Object
28 29 30 31 32 |
# File 'lib/app/models/bsdnet/current_entries.rb', line 28 def self.graphs { :current_entries => { :line_color => '#FF3300' }, } end |