Collectd-mod-contextswitch

Hi, I am interested in using this plugin, but when I install it it doe snot show up in luci and cannot be configured in it. I added the lines below to luci_statistics and restarted collectd, but it did not help: lsof does not show contextswitch.so open by collectd. What am I doing wrong?

config statistics 'collectd_contextswitch'
        option enable '0'

Why should it show up in Luci statistics?

collectd does not equal LuCI statistics. LuCI statistics uses collectd for data collection, but you need to also create the support in LuCI statistics for each collectd module. Having the collectd module installed in the router is necessary, but that does not create any support in LuCI by itself.

LuCI statistics knows only about a limited subset about collectd features, and offers settings and charts only for those collectd items that it has logic for.

If you want collectd_contextswitch, you need to build the data model for it and define the chart. As examples, the items done for cpufreq and thermal:


https://github.com/openwrt/luci/commit/1c27f6b462b7b488e75a5388198e97be00ba0835

Ps.
restarting only collectd is wrong. It will then use the "old config" generated at the time when luci_statistics was restarted last time. You need to restart luci_statistics to generate the corresponding new config for collectd.

Monkey see, monkey do! So I got the context switch plugin going in luci. The next step is to figure out the commit process. Is it as simple as sending a pull request against the lede-17.01 branch, or there is more magic to it? I cannot find any document on this...

New stuff gets first into LuCI master, not into 17.01.
So, a pull request against the LuCI master branch.

(But if you do the PR against 17.01 branch, I can cherry-pick it from that to the master. There is no relevant difference between master and 17.01 at the moment.)

Advice: https://github.com/openwrt/luci/blob/master/CONTRIBUTING.md

Sent a pull request against master. Do I need to send another PR against 17.01?

I tested it and it worked :wink:
I merged it to LuCI master. Thanks.

No need. I can cherry-pick it in a few days, after first seeing that it has caused no hiccup in the buildbot.

(If I don't remember to do that. just remind me.)

And one piece of advice regarding future LEDE/Openwrt package PRs:
Please start all commit titles with the package/module name

It is the first item in the CONTRIBUTING advice...

Regardless of whether you send a patch or open a pull request, please try to follow these rules:

Have a useful subject prefixed with the component name (E.g.: "luci-mod-admin-full: fix wifi channel selection on multiple STA networks")

Note the deviation...

perus@ub1704:/OwrtLEDE/r7800/feeds/luci$ git log --oneline | grep -v Merge | head
5bf636732 Support for collectd-mod-contextswitch
24a4825ae luci-app-adblock: Update Japanese translation
cab116bfb luci-app-adblock: Sync translations
2dd0bae80 luci-app-adblock: fix markup
3e0492fee luci-app-ddns: fix to correct system status
0e80aba7b luci-app-adblock: sync with 2.6.1
f45d8767a [luci-app-openvpn] Fixed ivalid checks for parameters in VPN tab. closes #887
466978282 luci-mod-admin-full: correct logic for dnsmasq boguspriv keyword
8701c8b00 luci-app-uhttpd: remove unnecessary fields from Makefile
fed6b9ef1 luci-app-dynapoint: remove unnecessary fields from Makefile

I will keep it in mind