#
# 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
repeat_header = auto
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
repeat_header = auto
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
repeat_header = auto
ignore_incompat = yes
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      = 100 * rate(proc.schedstat.run_delay)
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
iotot             = proc.io.bytes_total
iotot.label       = IO KB/s
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
net.label         = Net KB/s
net.formula       =
  defined(bpf.proc.net.tcp.recv.bytes)
  ?
    bpf.proc.net.tcp.recv.bytes + bpf.proc.net.tcp.send.bytes + bpf.proc.net.udp.recv.bytes + bpf.proc.net.udp.send.bytes
  :
    novalue(type=float, semantics=instant, units="KB/s")
net.unit          = KB/s
net.width         = 8

[proc-essential]
instinfo = no
unitinfo = no
precision = 2
repeat_header = auto
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 = Mem peak,,MB,,,0
iotot             = proc.io.bytes_total
iotot.label       = IO KB/s
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
iocml.label       = IO cml 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
repeat_header = auto
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            = 100 * rate(proc.schedstat.run_delay)
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
repeat_header = auto
proc.psinfo.vctxsw       = ctxsw,,/s,,7
proc.psinfo.nvctxsw      = nvctxsw,,/s,,7
proc.psinfo.minflt       = minflt,,,,
proc.psinfo.maj_flt      = majflt,,,,
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
repeat_header = auto
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
repeat_header = auto
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
repeat_header = auto
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 = ,,,,

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

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

[proc-net-ext]
instinfo = no
unitinfo = yes
precision = 0
repeat_header = auto
bpf.proc.net.tcp.recv.packets = TCP recv pkts,,,,
bpf.proc.net.tcp.send.packets = TCP send pkts,,,,
bpf.proc.net.udp.recv.packets = UDP recv pkts,,,,
bpf.proc.net.udp.send.packets = UDP send pkts,,,,

[proc-children]
instinfo = no
unitinfo = no
precision = 0
repeat_header = auto
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
repeat_header = auto
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        = ,,,,
