Module: NodeDashboardHelper

Defined in:
app/helpers/node_dashboard_helper.rb

Overview

You should have received a copy of the GNU General Public License along with ForemanFogProxmox. If not, see <www.gnu.org/licenses/>.

Instance Method Summary collapse

Instance Method Details

#compute_data(statistics) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'app/helpers/node_dashboard_helper.rb', line 22

def compute_data(statistics)
    data = []
    statistics.each do |statistic| 
        t = Time.at(statistic['time'])
        x = t.hour.to_s + ':' + t.min.to_s
        data << [x,statistic['loadavg']*100]
    end
    data
end

#render_node_statistics(statistics, options = {}) ⇒ Object



32
33
34
35
# File 'app/helpers/node_dashboard_helper.rb', line 32

def render_node_statistics(statistics,options = {})
    data = compute_data(statistics)
    flot_bar_chart("node_statistics", _("Time"), _("Average load (x100)"), data, options)
end