Skip to content

collectors ProcessResourcesCollector

sykp241095 edited this page Aug 2, 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=B
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.

count_workers defined under [process] will determine whether to count how many workers are there of processes which match this [process], for example: cgi workers.

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