unbit/uwsgi — pull request #495 by prymitive (2013-12-23 18:08:55+00:00)
Title: metrics support for cheaper busyness plugin

This patch adds:

* plugin.cheaper_busyness.total_avg_busyness - global metric with total average busyness of all running (not cheaped) workers
* "worker.N.plugin.cheaper_busyness.busyness - per worker busyness

I've picked .100.101 oid for this (.100. could be used as a base for all plugins?) so there is room for additional core metrics, but I'm really confused how this numbering will work for out-of-tree plugins that would like to expose metrics. How should developer of such metric pick this value? Would he need to first google for every other out-of-tree plugin and check if it doesn't use same oid? Oid can't be random, this needs to be constant value or SNMP stats will break (unless we ignore that, but we shouldn't). Also what would happen if there are 2 plugins loaded that try to register different metrics using the same oid?
Maybe we could allow to remap metric keys to different oids using --metric-map-oid "core.total_rss = 4.1.2.5" ?? But how would that work for per worker metrics? We would need to handle wildcards there ("worker.*.total_rss = 4.$.2.5" ??)