15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/app/models/jvm.rb', line 15
def self.threads_chart(options)
graphs = [:free, :swap_used]
graph_fields = graphs << :timestamp
chart = area_stacked_chart(:graphs => graphs, :value_axis_title => 'Number of threads', :chart_title => 'Java threads')
chart[:graph_data] = Jvm.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)
return chart
end
|