luci/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/cpufreq.js
Jo-Philipp Wich 72da3c4c55 luci-app-statistics: rearrange graph display
- Add a per-plugin overview tab that contains the (non-detail) graphs of
   each plugin instance, similar to the old Lua based implementation
 - Numerically order plugin instances starting with numbers
 - Avoid multiple renderings of the same graphs
 - Fix legend of tcpconns graphs
 - Move cpufreq distribution and transition charts to detail tabs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2020-02-22 23:32:44 +01:00

59 lines
1.3 KiB
JavaScript

/* Licensed to the public under the Apache License 2.0. */
'use strict';
'require uci';
return L.Class.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 ];
}
}
});