summaryrefslogtreecommitdiffstats
path: root/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/chrony.js
blob: 2064c7d3004a585b7b3b97dad14609b10bc4c86d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* Licensed to the public under the Apache License 2.0. */

'use strict';
'require baseclass';
'require uci';

return baseclass.extend({
	title: _('Chrony'),

	rrdargs(graph, host, plugin, plugin_instance, dtype) {
		const offset = {
			title: "%H: Chrony - time offset",
			vlabel: "Time offset (ms)",
			number_format: "%9.3lf ms",
			data: {
				types: [ "time_offset" ],
				options: {
					time_offset_chrony: {
						noarea: true,
						overlay: true,
						color: "ff0000",
						title: "%di",
						transform_rpn: "1000,*"
					},
					time_offset: {
						noarea: true,
						overlay: true,
						title: "%di",
						transform_rpn: "1000,*"
					}
				}
			}
		};

		const stratum = {
			title: "%H: Chrony - clock stratum",
			vlabel: "Clock stratum",
			number_format: "%3.1lf%S",
			data: {
				types: [ "clock_stratum" ],
				options: {
					clock_stratum_chrony: {
						noarea: true,
						overlay: true,
						color: "ff0000",
						title: "%di"
					},
					clock_stratum: {
						noarea: true,
						overlay: true,
						title: "%di"
					}
				}
			}
		};

		return [ offset, stratum ];

	}
});