treewide: import utility classes explicitly
[project/luci.git] / applications / luci-app-statistics / htdocs / luci-static / resources / statistics / rrdtool / definitions / cpufreq.js
1 /* Licensed to the public under the Apache License 2.0. */
2
3 'use strict';
4 'require baseclass';
5 'require uci';
6
7 return baseclass.extend({
8 title: _('CPU Frequency'),
9
10 rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
11 var cpufreq = {
12 title: "%H: Processor frequency - core %pi",
13 alt_autoscale: true,
14 vlabel: "Frequency (Hz)",
15 number_format: "%3.2lf%s",
16 data: {
17 types: [ "cpufreq" ],
18 options: {
19 cpufreq: { color: "ff0000", title: "Frequency" },
20 }
21 }
22 };
23
24 if (uci.get("luci_statistics", "collectd_cpufreq", "ExtraItems")) {
25 var transitions = {
26 detail: true,
27 title: "%H: Frequency transitions - core %pi",
28 alt_autoscale: true,
29 vlabel: "Transitions",
30 number_format: "%3.2lf%s",
31 data: {
32 types: [ "transitions" ],
33 options: {
34 transitions: { color: "0000ff", title: "Transitions", noarea: true },
35 }
36 }
37 };
38
39 var percentage = {
40 detail: true,
41 title: "%H: Frequency distribution - core %pi",
42 alt_autoscale: true,
43 vlabel: "Percent",
44 number_format: "%5.2lf%%",
45 ordercolor: true,
46 data: {
47 types: [ "percent" ],
48 options: {
49 percent: { title: "%di kHz", negweight: true },
50 }
51 }
52 };
53
54 return [ cpufreq, percentage, transitions ];
55 }
56 else {
57 return [ cpufreq ];
58 }
59 }
60 });