[collectd] How to get the total value over time of a DERIVE data source?

Francesco Romani fromani at redhat.com
Wed Jan 18 17:16:36 CET 2017


Hi all,


oVirt[1] developer here. Since few weeks I'm proposing patches[2] to
collectd to make it possible to use it in oVirt

to monitor hosts and vms instead of the current, custom-built oVirt
solution.


For accouting purposes, oVirt tracks some total values. For example, we
track and record the total bytes received or

sent through one network interface, or the total amount of bytes read
from or written to a disk.

Libvirt returns those totals,  example provided below.


collectd, however, exports most of the values we need to trackl as
DERIVE type, so we get changes since last value
(https://collectd.org/wiki/index.php/Data_source)

If neither the client nor the collectd are ever restarted, we can track
the changes, so it is good; but in general oVirt needs a way to be sure
and safe it has the correct

total (e.g. total bytes through one network interface - if_octets).


I had a quick look at the docs and to the existing plugins without much
luck; apologies if I missed something obvious, in that case

a like to the Fine Manual would be much appreciated :)


Thanks and bests,


+++


[1] http://www.ovirt.org/

[2] https://github.com/collectd/collectd/pull/2103



+++


(virsh -r domstats, libvirt 2.0.0 - but the concept applies to old APIs
as well

Example output


Domain: 'a2'
  state.state=1
  state.reason=1
  cpu.time=35069893576
  cpu.user=4360000000
  cpu.system=4000000000
  balloon.current=4194304
  balloon.maximum=4194304
  vcpu.current=2
  vcpu.maximum=16
  vcpu.0.state=1
  vcpu.0.time=18910000000
  vcpu.0.wait=0
  vcpu.1.state=1
  vcpu.1.time=13630000000
  vcpu.1.wait=0
  net.count=1
  net.0.name=vnet0
  net.0.rx.bytes=65752
  net.0.rx.pkts=413
  net.0.rx.errs=0
  net.0.rx.drop=0
  net.0.tx.bytes=23554
  net.0.tx.pkts=289
  net.0.tx.errs=0
  net.0.tx.drop=0
  block.count=2
  block.0.name=hdc
  block.0.path=[expunged]
  block.0.rd.reqs=33146
  block.0.rd.bytes=275919200
  block.0.rd.times=787752279
  block.0.wr.reqs=0
  block.0.wr.bytes=0
  block.0.wr.times=0
  block.0.fl.reqs=0
  block.0.fl.times=0
  block.0.allocation=0
  block.0.capacity=1469054976
  block.0.physical=1469059072
  block.1.name=vda
  block.1.path=[expunged]
  block.1.rd.reqs=129
  block.1.rd.bytes=3215872
  block.1.rd.times=138113797
  block.1.wr.reqs=0
  block.1.wr.bytes=0
  block.1.wr.times=0
  block.1.fl.reqs=0
  block.1.fl.times=0
  block.1.allocation=0
  block.1.capacity=21474836480
  block.1.physical=16777216


-- 
Francesco Romani
Red Hat Engineering Virtualization R & D
IRC: fromani




More information about the collectd mailing list