luci/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js
Jo-Philipp Wich 3c4bc228a1 treewide: import utility classes explicitly
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-04-03 10:00:06 +02:00

60 lines
1.3 KiB
JavaScript

/* Licensed to the public under the Apache License 2.0. */
'use strict';
'require baseclass';
'require uci';
return baseclass.extend({
title: _('CPU Frequency'),
rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
var cpufreq = {
title: "%H: Processor frequency - core %pi",
alt_autoscale: true,
vlabel: "Frequency (Hz)",
number_format: "%3.2lf%s",
data: {
types: [ "cpufreq" ],
options: {
cpufreq: { color: "ff0000", title: "Frequency" },
}
}
};
if (uci.get("luci_statistics", "collectd_cpufreq", "ExtraItems")) {
var transitions = {
detail: true,
title: "%H: Frequency transitions - core %pi",
alt_autoscale: true,
vlabel: "Transitions",
number_format: "%3.2lf%s",
data: {
types: [ "transitions" ],
options: {
transitions: { color: "0000ff", title: "Transitions", noarea: true },
}
}
};
var percentage = {
detail: true,
title: "%H: Frequency distribution - core %pi",
alt_autoscale: true,
vlabel: "Percent",
number_format: "%5.2lf%%",
ordercolor: true,
data: {
types: [ "percent" ],
options: {
percent: { title: "%di kHz", negweight: true },
}
}
};
return [ cpufreq, percentage, transitions ];
}
else {
return [ cpufreq ];
}
}
});