Merge pull request #1132 from fantom-x/luci-collectd-mod-contextswitch
Support for collectd-mod-contextswitch
This commit is contained in:
commit
1497d4ad48
5 changed files with 48 additions and 1 deletions
|
@ -24,6 +24,7 @@ function index()
|
||||||
s_network = _("Network plugins"),
|
s_network = _("Network plugins"),
|
||||||
|
|
||||||
conntrack = _("Conntrack"),
|
conntrack = _("Conntrack"),
|
||||||
|
contextswitch = _("Context Switches"),
|
||||||
cpu = _("Processor"),
|
cpu = _("Processor"),
|
||||||
cpufreq = _("CPU Frequency"),
|
cpufreq = _("CPU Frequency"),
|
||||||
csv = _("CSV Output"),
|
csv = _("CSV Output"),
|
||||||
|
@ -58,7 +59,7 @@ function index()
|
||||||
-- our collectd menu
|
-- our collectd menu
|
||||||
local collectd_menu = {
|
local collectd_menu = {
|
||||||
output = { "csv", "network", "rrdtool", "unixsock" },
|
output = { "csv", "network", "rrdtool", "unixsock" },
|
||||||
general = { "cpu", "cpufreq", "df", "disk", "email",
|
general = { "contextswitch", "cpu", "cpufreq", "df", "disk", "email",
|
||||||
"entropy", "exec", "irq", "load", "memory",
|
"entropy", "exec", "irq", "load", "memory",
|
||||||
"nut", "processes", "sensors", "thermal", "uptime" },
|
"nut", "processes", "sensors", "thermal", "uptime" },
|
||||||
network = { "conntrack", "dns", "interface", "iptables",
|
network = { "conntrack", "dns", "interface", "iptables",
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
-- Licensed to the public under the Apache License 2.0.
|
||||||
|
|
||||||
|
m = Map("luci_statistics",
|
||||||
|
translate("CPU Context Switches Plugin Configuration"),
|
||||||
|
translate("This plugin collects statistics about the processor context switches."))
|
||||||
|
|
||||||
|
-- collectd_contextswitch config section
|
||||||
|
s = m:section( NamedSection, "collectd_contextswitch", "luci_statistics" )
|
||||||
|
|
||||||
|
-- collectd_contextswitch.enable
|
||||||
|
enable = s:option( Flag, "enable", translate("Enable this plugin") )
|
||||||
|
enable.default = 0
|
||||||
|
|
||||||
|
return m
|
|
@ -0,0 +1,23 @@
|
||||||
|
-- Licensed to the public under the Apache License 2.0.
|
||||||
|
|
||||||
|
module("luci.statistics.rrdtool.definitions.contextswitch",package.seeall)
|
||||||
|
|
||||||
|
function rrdargs( graph, plugin, plugin_instance, dtype )
|
||||||
|
|
||||||
|
return {
|
||||||
|
title = "%H: Context switches",
|
||||||
|
alt_autoscale = true,
|
||||||
|
vlabel = "Switches/s",
|
||||||
|
number_format = "%5.0lf",
|
||||||
|
data = {
|
||||||
|
types = { "contextswitch" },
|
||||||
|
sources = {
|
||||||
|
contextswitch = { "value" }
|
||||||
|
},
|
||||||
|
options = {
|
||||||
|
contextswitch = { color = "0000ff", title = "Context switches", noarea=true, overlay=true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
|
@ -162,3 +162,6 @@ config statistics 'collectd_thermal'
|
||||||
config statistics 'collectd_uptime'
|
config statistics 'collectd_uptime'
|
||||||
option enable '0'
|
option enable '0'
|
||||||
|
|
||||||
|
config statistics 'collectd_contextswitch'
|
||||||
|
option enable '0'
|
||||||
|
|
||||||
|
|
|
@ -279,6 +279,12 @@ plugins = {
|
||||||
{ }
|
{ }
|
||||||
},
|
},
|
||||||
|
|
||||||
|
contextswitch = {
|
||||||
|
{ },
|
||||||
|
{ },
|
||||||
|
{ }
|
||||||
|
},
|
||||||
|
|
||||||
csv = {
|
csv = {
|
||||||
{ "DataDir" },
|
{ "DataDir" },
|
||||||
{ "StoreRates" },
|
{ "StoreRates" },
|
||||||
|
|
Loading…
Reference in a new issue