python-diamond / Diamond

Diamond is a python daemon that collects system metrics and publishes them to Graphite (and others). It is capable of collecting cpu, memory, network, i/o, load and disk metrics. Additionally, it features an API for implementing custom collectors for gathering metrics from almost any source.
http://diamond.readthedocs.org/
MIT License
1.74k stars 601 forks source link

memcached collector: support for mcrouter #662

Closed ct16k closed 2 years ago

ct16k commented 7 years ago

Mcrouter is a memcached router. It's stats command is mostly compatible with that of memcached, while also providing some specific mcrouter metrics. As such diamond's memcached collector could be used successfully for mcrouter as well. Recently though, FB have added a new stat, commandargs, that returns the parameters the service was started with. This broke the collector as it wasn't part of the ignored list, but not an int either.

This patch adds support for this stat, in that instead of ignoring it, it will use it to report the configured max number of connections by looking for the --max-conns parameter, just as the -c argument is processed for memcached.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 24.667% when pulling cc2d726052637fc803a3142f67bc5430998f69d9 on ct16k:master into f2bece462577a7c557be8a9f90f6b9340c3db571 on python-diamond:master.