Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

pmie and pminfo #40

Closed
pcpuser001 opened this Issue Aug 14, 2015 · 3 comments

Comments

Projects
None yet
3 participants

for a metric disk.dev.total, using pmino -f disk.dev.total the value got is
disk.dev.total
inst [0 or "sda"] value 3902261

when we execute :/var/lib/pcp/config/pmie$ pmie -c test.disk

sh: 2: disk.dev.total 6.1

test.disk has following content
disk.dev.total > 1
-> shell 1 mins "echo
'disk.dev.total %v'";

my question is does the value of pminfo 3902261 and value of pmie 6.1 should be same ? since both gives same metric's value. Please correct me if am wrong.

Thanks in advance.

Contributor

kmcdonell commented Aug 14, 2015

This metric is a counter.

pminfo reports the current value of the metric.

For a counter, pmie samples once, waits, samples again and reports the average rate over the sample interval.

Hi kmcdonell,
Thank you for the reply.
for pmie is there any way to obtain the current value rather then taking average rate over the sample interval. if you see the below example time is not specified except shell time is to execute shall command every one min .
disk.dev.total > 1
-> shell 1 mins "echo
'disk.dev.total %v'";

Thanks in advance.

Contributor

kmcdonell commented Aug 14, 2015

I suspect there are a number of conceptual problems here.

If a metric (x) is a counter, then the value of the metric is monotonic increasing from some arbitrary point in the past (usually boot time or pmda start time). Now if I represent the value of x at time t as x(t), then typically what one is interested in is the rate at which x increases over a time period, so this is (x(t2)-x(t1))/(t2-t1). This is exactly what pmie will report for a counter. The is exactly what sar, iostat, vmstat, top, et al report for things like cpu use, disk i/os, network packets, network bytes in and out, ...

If you really want the value of the counter right now then use pminfo or the instant operator for pmie.

Secondly, disk.dev.total is a metric defined over an instance domain (one value per disk) so to pmie this has a set value, and the pmie rules you're using are syntactically incorrect. This is what you probably need:
some_inst (instant disk.dev.total) > 0
-> print "current values:" " [%i]=%v";
some_inst disk.dev.total > 0 -> print "rates:" " [%i]=%v";

and as you can see from the output below ... there is no value for the rate converted metric at the first sample and the after the rate = the difference in the raw numbers / 2 (the update interval, via -t)
kenj@bozo:/tmp$ pmie -t 2 -c eek
Sat Aug 15 06:29:03 2015: current values: [sda]=13802540 [sdb]=13169610
Sat Aug 15 06:29:05 2015: current values: [sda]=13802551 [sdb]=13169610
Sat Aug 15 06:29:05 2015: rates: [sda]=5.5
Sat Aug 15 06:29:07 2015: current values: [sda]=13802555 [sdb]=13169625
Sat Aug 15 06:29:07 2015: rates: [sda]=2.00 [sdb]=7.5

@natoscott natoscott closed this Aug 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment