#
# pmrep(1) configuration file - see pmrep.conf(5)
#


# Compact metric specifications are of form (see pmrep(1)):
#pcp.metric.name = label,instances,unit/scale,type,width,precision,limit


#
# Per-process metricsets
#
[proc-info]
instinfo = no
unitinfo = no
precision = 0
proc.psinfo.pid     = PID,,,,7
proc.id.uid_nm      = USER,,,,9
proc.psinfo.cmd     = Command,,,,12
proc.psinfo.psargs  = Cmd line arguments,,,,48
proc.psinfo.ttyname = TTY,,,,8
proc.psinfo.age     = Age (s),,,,8

[proc-info-ext]
instinfo = no
unitinfo = no
precision = 0
proc.id.uid           = UID,,,,7
proc.id.gid           = GID,,,,7
proc.psinfo.pid       = PID,,,,7
proc.psinfo.ppid      = PPID,,,,7
proc.psinfo.session   = Session,,,,7
proc.namespaces.pid   = NS PID,,,,7
proc.namespaces.sid   = NS SID,,,,7
proc.id.container     = Container ID,,,,13
proc.psinfo.oom_score = OOM score,,,,9

[proc-activity]
instinfo = no
unitinfo = no
precision = 2
proc.psinfo.pid   = PID,,,,7
proc.psinfo.cmd   = Command,,,,12
cpupct            = proc.psinfo.cpu.pct
cpupct.label      = CPU %%
cpupct.formula    = 100 * (rate(proc.psinfo.utime) + rate(proc.psinfo.stime))
cpupct.width      = 7
upct              = proc.psinfo.cpu.util.user
upct.label        = %%usr
upct.formula      = 100 * rate(proc.psinfo.utime)
upct.width        = 7
spct              = proc.psinfo.cpu.util.sys
spct.label        = %%sys
spct.formula      = 100 * rate(proc.psinfo.stime)
spct.width        = 7
wpct              = proc.schedstat.waitpct
wpct.label        = %%wait
wpct.formula      = (rate(proc.schedstat.cpu_time) - rate(proc.schedstat.run_delay)) / rate(proc.schedstat.cpu_time)
wpct.width        = 7
mempct            = proc.memory.pct
mempct.label      = Mem %%
mempct.formula    = 100 * ((proc.memory.vmrss + proc.memory.vmswap) / hinv.physmem)
mempct.width      = 7
memreal           = proc.memory.vmreal
memreal.label     = Mem MB
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.label       = IO KB/s
iotot.formula     = instant(proc.io.read_bytes) + instant(proc.io.write_bytes) - instant(proc.io.cancelled_write_bytes)
iotot.unit        = KB/s
iotot.width       = 8
net               = bcc.proc.net.total.bytes
net.label         = Net KB/s
net.formula       = bcc.proc.net.tcp.recv.bytes + bcc.proc.net.tcp.send.bytes + bcc.proc.net.udp.recv.bytes + bcc.proc.net.udp.send.bytes
net.unit          = KB/s
net.width         = 8

[proc-essential]
instinfo = no
unitinfo = no
precision = 2
proc.psinfo.pid   = PID,,,,7
proc.psinfo.cmd   = Command,,,,12
cpupct            = proc.psinfo.cpu.pct
cpupct.label      = CPU %%
cpupct.formula    = 100 * (rate(proc.psinfo.utime) + rate(proc.psinfo.stime))
cpupct.width      = 7
cpuratio          = proc.psinfo.cpu.ratio
cpuratio.label    = CPU ratio
cpuratio.formula  = 100 * (instant(proc.psinfo.utime) + instant(proc.psinfo.stime)) / (kernel.all.uptime - proc.psinfo.start_time)
cpuratio.width    = 9
mempct            = proc.memory.pct
mempct.label      = MEM %%
mempct.formula    = 100 * ((proc.memory.vmrss + proc.memory.vmswap) / hinv.physmem)
mempct.width      = 7
memreal           = proc.memory.vmreal
memreal.label     = Mem MB
memreal.formula   = proc.memory.vmrss + proc.memory.vmswap
memreal.width     = 9
memreal.unit      = MB
memreal.precision = 0
proc.memory.vmhwm = Peak mem,,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.label       = IO KB/s
iotot.formula     = instant(proc.io.read_bytes) + instant(proc.io.write_bytes) - instant(proc.io.cancelled_write_bytes)
iotot.unit        = KB/s
iotot.width       = 8
iocml             = proc.io.cml_bytes
iocml.label       = Cumul IO MB
iocml.formula     = instant(proc.io.read_bytes) + instant(proc.io.write_bytes) - instant(proc.io.cancelled_write_bytes)
iocml.unit        = MB
iocml.precision   = 0

[proc-cpu]
instinfo = no
unitinfo = no
precision = 2
proc.psinfo.cpusallowed = CPUs allow,,,,12
proc.psinfo.processor   = CPU,,,,5
upct                    = proc.psinfo.cpu.util.user
upct.label              = %%usr
upct.formula            = 100 * rate(proc.psinfo.utime)
upct.width              = 7
spct                    = proc.psinfo.cpu.util.sys
spct.label              = %%sys
spct.formula            = 100 * rate(proc.psinfo.stime)
spct.width              = 7
wpct                    = proc.schedstat.waitpct
wpct.label              = %%wait
wpct.formula            = (rate(proc.schedstat.cpu_time) - rate(proc.schedstat.run_delay)) / rate(proc.schedstat.cpu_time)
proc.psinfo.threads     = Threads,,,,
proc.psinfo.sname       = State,,,,
proc.psinfo.policy_s    = Policy,,,,
proc.psinfo.rt_priority = RTPrio,,,,
proc.psinfo.priority    = Prio,,,,
proc.psinfo.nice        = Nice,,,,

[proc-cpu-ext]
instinfo = no
unitinfo = no
precision = 0
proc.psinfo.vctxsw       = ctxsw,,/s,,7
proc.psinfo.nvctxsw      = nvctxsw,,/s,,7
proc.psinfo.minflt       = minflt/s,,,,
proc.psinfo.maj_flt      = majflt/s,,,,
proc.schedstat.pcount    = Run count,,,,
proc.schedstat.cpu_time  = CPU time,,ms/s,,
proc.schedstat.run_delay = Run delay,,ms/s,,
proc.psinfo.wchan_s      = wchan,,,,12
proc.psinfo.blocked_s    = Block mask,,,,16

[proc-mem]
instinfo = no
unitinfo = yes
precision = 0
proc.psinfo.nswap    = ,,,,
proc.memory.vmsize   = ,,KB,,
proc.memory.vmreal   = ,,KB,,
proc.memory.vmrss    = ,,KB,,
proc.memory.vmnonlib = ,,KB,,
proc.memory.vmlib    = ,,KB,,
proc.memory.vmswap   = ,,KB,,

[proc-mem-ext]
instinfo = no
unitinfo = yes
precision = 0
proc.memory.vmdata  = ,,KB,,
proc.memory.vmexe   = ,,KB,,
proc.memory.vmpeak  = ,,KB,,
proc.memory.vmhwm   = ,,KB,,
proc.memory.vmlock  = ,,KB,,
proc.memory.vmstack = ,,KB,,
proc.memory.vmpte   = ,,KB,,

[proc-io]
instinfo = no
unitinfo = yes
precision = 2
proc.fd.count                    = FDs,,,,8
proc.io.read_bytes               = ,,KB/s,,
proc.io.write_bytes              = ,,KB/s,,
proc.io.total_bytes              = ,,KB/s,,
proc.io.cancelled_write_bytes    = ,,KB/s,,
proc.psinfo.delayacct_blkio_time = ,,,,
#bcc.proc.io.total                = ,,KB/s,,

[proc-io-ext]
instinfo = no
unitinfo = yes
precision = 2
proc.io.rchar = ,,KB/s,,
proc.io.wchar = ,,KB/s,,
proc.io.syscr = ,,,,
proc.io.syscw = ,,,,

[proc-net]
instinfo = no
unitinfo = yes
precision = 2
bcc.proc.net.tcp.recv.bytes = TCP recv,,KB/s,,
bcc.proc.net.tcp.send.bytes = TCP send,,KB/s,,
bcc.proc.net.udp.recv.bytes = UDP recv,,KB/s,,
bcc.proc.net.udp.send.bytes = UDP send,,KB/s,,

[proc-net-ext]
instinfo = no
unitinfo = yes
precision = 0
bcc.proc.net.tcp.recv.calls = ,,,,
bcc.proc.net.tcp.send.calls = ,,,,
bcc.proc.net.udp.recv.calls = ,,,,
bcc.proc.net.udp.send.calls = ,,,,

[proc-children]
instinfo = no
unitinfo = no
precision = 0
proc.psinfo.cutime      = cutime,,ms/s,,
proc.psinfo.cstime      = cstime,,ms/s,,
proc.psinfo.cguest_time = cguest,,ms/s,,
proc.psinfo.cmin_flt    = cminflt,,,,
proc.psinfo.cmaj_flt    = cmajflt,,,,
proc.psinfo.cnswap      = cnswap,,,,

#[proc-java]
#bcc.usdt.jvm.threads.start = ,,,,
#bcc.usdt.jvm.threads.stop  = ,,,,

#[proc-java-ext]
#bcc.usdt.jvm.alloc = ,,,,

#[proc-int-stats]
#bcc.usdt.hits                = ,,,,
#bcc.uprobe.hits              = ,,,,
#bcc.tracepoint.hits          = ,,,,
#bcc.proc.syscall.count       = ,,,,
#bcc.proc.syscall.latency.avg = ,,,,
#bcc.proc.syscall.latency.cml = ,,,,

#[proc-int-stats-ext]
#bcc.proc.ucall.count       = ,,,,
#bcc.proc.ucall.latency.avg = ,,,,
#bcc.proc.ucall.latency.cml = ,,,,
#bcc.proc.ustat.thread      = ,,,,
#bcc.proc.ustat.method      = ,,,,
#bcc.proc.ustat.object      = ,,,,
#bcc.proc.ustat.class       = ,,,,
#bcc.proc.ustat.except      = ,,,,
#bcc.proc.ustat.gc          = ,,,,

[proc-os-stats]
instinfo = no
unitinfo = no
precision = 2
kernel.all.sysfork = ,,,,
proc.runq.runnable = ,,,,
proc.runq.blocked  = ,,,,
proc.runq.sleeping = ,,,,
proc.runq.stopped  = ,,,,
proc.runq.swapped  = ,,,,
proc.runq.defunct  = ,,,,
proc.runq.unknown  = ,,,,
utotal             = proc.runq.utotal
utotal.formula     = proc.runq.runnable + proc.runq.blocked + proc.runq.sleeping + proc.runq.stopped + proc.runq.swapped + proc.runq.defunct + proc.runq.unknown
proc.runq.kernel   = ,,,,
proc.nprocs        = ,,,,
