1 /* Licensed to the public under the Apache License 2.0. */
7 return baseclass
.extend({
10 rrdargs: function(graph
, host
, plugin
, plugin_instance
, dtype
) {
13 var title
= "%H: Processor usage";
15 if (plugin_instance
!= '')
16 title
= "%H: Processor usage on core #%pi";
18 var show_idle
= uci
.get("luci_statistics", "collectd_cpu", "ShowIdle") == "1" ? true : false;
20 if (uci
.get("luci_statistics", "collectd_cpu", "ReportByState") == "1") {
24 alt_autoscale_max
: true,
26 number_format
: "%5.1lf",
30 ...(show_idle
? ["idle"] : []),
80 alt_autoscale_max
: true,
82 number_format
: "%5.1lf%%",
86 ...(show_idle
? ["idle"] : []),
133 var types
= graph
.dataTypes(host
, plugin
, plugin_instance
);
135 for (var i
= 0; i
< types
.length
; i
++)
136 if (types
[i
] == 'cpu')
138 else if (types
[i
] == 'percent')
145 alt_autoscale_max
: true,
147 number_format
: "%5.1lf%%",