Skip to content

collectors ProcessResourcesCollector

Rob Smith edited this page Apr 19, 2013 · 9 revisions

ProcessResourcesCollector

A Diamond collector that collects memory usage of each process defined in it's config file by matching them with their executable filepath or the process name. This collector can also be used to collect memory usage for the Diamond process.

Example config file ProcessResourcesCollector.conf

enabled=True
unit=kB
cpu_interval=0.1
[process]
[[postgres]]
exe=^\/usr\/lib\/postgresql\/+d.+d\/bin\/postgres$
name=^postgres,^pg

[[diamond]]
selfmon=True

exe and name are both lists of comma-separated regexps.

cpu_interval is the interval in seconds used to calculate cpu usage percentage. From psutil's docs:

'''get_cpu_percent(interval=0.1)''' Return a float representing the process CPU utilization as a percentage.

  • When interval is > 0.0 compares process times to system CPU times elapsed before and after the interval (blocking).
  • When interval is 0.0 compares process times to system CPU times elapsed since last call, returning immediately. In this case is recommended for accuracy that this function be called with at least 0.1 seconds between calls.

Options - Generic Options

Setting Default Description Type
byte_unit byte Default numeric output(s) str
cpu_interval 0.1 The time interval used to calculate cpu percentage
* When interval is > 0.0 compares process times to system CPU times elapsed
before and after the interval (blocking).
* When interval is 0.0 compares process times to system CPU times
elapsed since last call, returning immediately. In this case is recommended
for accuracy that this function be called with at least 0.1 seconds between
calls.
float
enabled False Enable collecting these metrics bool
measure_collector_time False Collect the collector run time in ms bool
process A subcategory of settings inside of which each collected process has it's configuration str
unit B The unit in which memory data is collected. str

Example Output

__EXAMPLESHERE__

This file was generated from the python source

Please edit the source to make changes

Clone this wiki locally