Skip to content

Commit

Permalink
pmrep conf: fix and update pmrep proc metricsets
Browse files Browse the repository at this point in the history
Use (more) correct rate() for total IO/s formula, also avoid reusing
the derived metric name already defined in the libpcp derived config.

Drop the IO % metric which was supposed to show how large a portion
the process is responsible for all of the IO. The formula did not
work on many occasions when per-process IO statistics were updated
in real-time but the totals (disk.all.*) only when the kernel really
wrote the data to disks.

In theory one might be able to calculate this by summing all the
process IO but the derived metric language does not allow doing a
calculation like delta(x) / sum(x) and this would also need some
pmrep changes to create an exception when to fetch all instance
values even if only reporting for few selected ones. Currently
this does not seem like worth the effort.
  • Loading branch information
myllynen committed Apr 17, 2024
1 parent 83b7f87 commit 5b0c93d
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/pmrep/conf/proc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,9 @@ memreal.formula = proc.memory.vmrss + proc.memory.vmswap
memreal.width = 9
memreal.unit = MB
memreal.precision = 0
iopct = proc.io.pct
iopct.label = IO %%
iopct.formula = 100 * ((delta(proc.io.read_bytes) + delta(proc.io.write_bytes) - delta(proc.io.cancelled_write_bytes)) / (delta(disk.all.read_bytes) + delta(disk.all.write_bytes)))
iopct.width = 7
iotot = proc.io.total_bytes
iotot = proc.io.bytes_total
iotot.label = IO KB/s
iotot.formula = instant(proc.io.read_bytes) + instant(proc.io.write_bytes) - instant(proc.io.cancelled_write_bytes)
iotot.formula = rate(proc.io.read_bytes) + rate(proc.io.write_bytes) - rate(proc.io.cancelled_write_bytes)
iotot.unit = KB/s
iotot.width = 8
net = bpf.proc.net.total.bytes
Expand Down Expand Up @@ -111,13 +107,9 @@ memreal.width = 9
memreal.unit = MB
memreal.precision = 0
proc.memory.vmhwm = Mem peak,,MB,,,0
iopct = proc.io.pct
iopct.label = IO %%
iopct.formula = 100 * ((delta(proc.io.read_bytes) + delta(proc.io.write_bytes) - delta(proc.io.cancelled_write_bytes)) / (delta(disk.all.read_bytes) + delta(disk.all.write_bytes)))
iopct.width = 7
iotot = proc.io.total_bytes
iotot = proc.io.bytes_total
iotot.label = IO KB/s
iotot.formula = instant(proc.io.read_bytes) + instant(proc.io.write_bytes) - instant(proc.io.cancelled_write_bytes)
iotot.formula = rate(proc.io.read_bytes) + rate(proc.io.write_bytes) - rate(proc.io.cancelled_write_bytes)
iotot.unit = KB/s
iotot.width = 8
iocml = proc.io.cml_bytes
Expand Down

0 comments on commit 5b0c93d

Please sign in to comment.