#
# pmrep configuration file
#

# General options
[options]
#version = 1
#source = local:
#output = stdout
#speclocal =
#derived = /path/derived.conf
#daemonize = no
#header = yes
#unitinfo = yes
#globals = yes
#timestamp = no
#samples =
#interval = 1s
#delay = no
#type = default
#ignore_incompat = no
#instances =
#omit_flat = no
#colxrow =
#width =
#precision = 3
#delimiter =
#extcsv = no
#extheader = no
#repeat_header = 0
#timefmt = %H:%M:%S
#interpol = yes
#count_scale = count
#space_scale = kB
#time_scale = sec
##includedir =

# Compact metric specifications are of form:
#pcp.metric.name = label,instance(s),unit/scale,type,column-width

# Global metrics are displayed as part of any set (unless disabled with -G)
[global]
#nproc = kernel.all.runnable
#kernel.all.runnable = nproc,,,,

# sar -w example
[sar-w]
header = yes
unitinfo = no
globals = no
timestamp = yes
interval = 1s
type = default
precision = 2
sysfork = kernel.all.sysfork
sysfork.label = proc/s
sysfork.width = 11
pswitch = kernel.all.pswitch
pswitch.label = cswch/s
pswitch.width = 8

# sar -W example
[sar-W]
header = yes
unitinfo = no
globals = no
timestamp = yes
interval = 1s
type = default
precision = 2
time_scale = s
pswpin = mem.vmstat.pswpin
pswpin.label = pswpin/s
pswpin.width = 10
pswpout = mem.vmstat.pswpout
pswpout.label = pswpout/s
pswpout.width = 10

# vmstat example
[vmstat]
header = yes
unitinfo = no
globals = no
timestamp = no
interval = 1s
type = default
precision = 0
repeat_header = 22
kernel.all.running = r,,,,
kernel.all.blocked = b,,,,
swap.used = swpd,,,,
mem.util.free = free,,,,8
mem.util.bufmem = buff,,,,8
allcache = mem.util.allcache
allcache.label = cache
allcache.formula = mem.util.cached + mem.util.slab
allcache.width = 8
swap.pagesin = si,,,,
swap.pagesout = so,,,,
mem.vmstat.pgpgin = bi,,,,6
mem.vmstat.pgpgout = bo,,,,6
kernel.all.intr = in,,,,6
kernel.all.pswitch = cs,,,,6
alluser = kernel.all.cpu.alluserp
alluser.label = us
alluser.formula = 100 * (kernel.all.cpu.user + kernel.all.cpu.nice) / hinv.ncpu
alluser.unit = s
sys = kernel.all.cpu.sysp
sys.label = sy
sys.formula = 100 * kernel.all.cpu.sys / hinv.ncpu
sys.unit = s
idle = kernel.all.cpu.idlep
idle.label = id
idle.formula = 100 * kernel.all.cpu.idle / hinv.ncpu
idle.unit = s
wtotal = kernel.all.cpu.wait.totalp
wtotal.label =  wa
wtotal.formula = 100 * kernel.all.cpu.wait.total / hinv.ncpu
wtotal.unit = s
steal = kernel.all.cpu.stealp
steal.label = st
steal.formula = 100 * kernel.all.cpu.steal / hinv.ncpu
steal.unit = s

# An example metric set
[example-1]
timestamp = yes
interval = 2s
type = default
space_scale = MB
read = disk.all.read_bytes
read.width = 6
write = disk.all.write_bytes
write.width = 6
if = network.interface.total.bytes
if.unit = kB
if.width = 10

# Another example set
[example-2]
width = 10
space_scale = kB
dpr_b = disk.partitions.read_bytes
dpw_b = disk.partitions.write_bytes
cached = mem.util.allcache
cached.formula = mem.util.cached + mem.util.slab
cached.label = mem_c

# Per process metrics
[proc-info]
derived = proc.psinfo.age = kernel.all.uptime - proc.psinfo.start_time
proc.psinfo.pid = ,,
proc.id.uid_nm = ,,
proc.psinfo.cmd = ,,,,16
proc.psinfo.psargs = ,,,,32
proc.psinfo.ttyname = ,,
proc.psinfo.age = ,,

[proc-info-ext]
proc.psinfo.pid = ,,
proc.psinfo.ppid = ,,
proc.psinfo.session = ,,
proc.id.uid = ,,
proc.id.gid = ,,
proc.id.euid = ,,
proc.id.egid = ,,
proc.namespaces.pid = ,,
proc.namespaces.sid = ,,

[proc-essential]
proc.psinfo.pid = ,,
proc.psinfo.cmd = ,,,,16
cpupct = proc.psinfo.cpu.pct
cpupct.formula = 100 * (rate(proc.psinfo.utime) + rate(proc.psinfo.stime))
cpuratio = proc.psinfo.cpu.ratio
cpuratio.formula = 100 * (instant(proc.psinfo.utime) + instant(proc.psinfo.stime)) / (kernel.all.uptime - proc.psinfo.start_time)
mempct = proc.memory.pct
mempct.formula = 100 * ((proc.memory.vmrss + proc.memory.vmswap) / hinv.physmem)
memreal = proc.memory.vmreal
memreal.formula = proc.memory.vmrss + proc.memory.vmswap
proc.memory.vmhwm = ,,
iopct = p.i.io_pct
iopct.formula = delta(disk.all.read_bytes) + delta(disk.all.write_bytes) == 0 ? mkconst(0, type="double", semantics="instant") : 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))
iotot = proc.io.total_bytes
iotot.formula = instant(proc.io.read_bytes) + instant(proc.io.write_bytes) - instant(proc.io.cancelled_write_bytes)
iotot.unit = kb/s
iototal = p.i.cum_bytes
iototal.formula = instant(proc.io.read_bytes) + instant(proc.io.write_bytes) - instant(proc.io.cancelled_write_bytes)
iototal.unit = kb

[proc-cpu]
proc.psinfo.processor = ,,
proc.psinfo.priority = ,,
proc.psinfo.nice = ,,
cpupct = proc.psinfo.cpu.pct
cpupct.formula = 100 * (rate(proc.psinfo.utime) + rate(proc.psinfo.stime))
cpuratio = proc.psinfo.cpu.ratio
cpuratio.formula = 100 * (instant(proc.psinfo.utime) + instant(proc.psinfo.stime)) / (kernel.all.uptime - proc.psinfo.start_time)
proc.psinfo.threads = ,,
proc.psinfo.sname = ,,
proc.psinfo.utime = ,,
proc.psinfo.stime = ,,

[proc-cpu-ext]
proc.psinfo.vctxsw = ,,
proc.psinfo.nvctxsw = ,,
proc.psinfo.minflt = ,,
proc.psinfo.maj_flt = ,,
proc.schedstat.cpu_time = ,,ms/s
proc.schedstat.pcount = ,,
proc.schedstat.run_delay = ,,ms/s
proc.psinfo.wchan_s = ,,
proc.psinfo.blocked_s = ,,

[proc-mem]
derived = proc.memory.vmreal = proc.memory.vmrss + proc.memory.vmswap,proc.memory.vmnonlib = proc.memory.vmrss + proc.memory.vmswap - proc.memory.vmlib
proc.memory.vmsize = ,,
proc.memory.vmreal = ,,
proc.memory.vmrss = ,,
proc.memory.vmlib = ,,
proc.memory.vmnonlib = ,,
proc.memory.vmswap = ,,

[proc-mem-ext]
proc.memory.vmdata = ,,
proc.memory.vmexe = ,,
proc.memory.vmpeak = ,,
proc.memory.vmhwm = ,,
proc.memory.vmlock = ,,
proc.memory.vmstack = ,,

[proc-io]
derived = proc.io.total_bytes = instant(proc.io.read_bytes) + instant(proc.io.write_bytes) - instant(proc.io.cancelled_write_bytes)
proc.fd.count = ,,
proc.io.total_bytes = ,,kb/s
proc.io.read_bytes = ,,kb/s
proc.io.write_bytes = ,,kb/s
proc.io.rchar = ,,kb/s
proc.io.wchar = ,,kb/s

[proc-io-ext]
proc.io.syscr = ,,
proc.io.syscw = ,,
proc.io.cancelled_write_bytes = ,,
proc.psinfo.delayacct_blkio_time = ,,

#[proc-net]
#[proc-net-ext]

[proc-children]
proc.psinfo.cmin_flt = ,,
proc.psinfo.cmaj_flt = ,,
proc.psinfo.cutime = ,,ms/s
proc.psinfo.cstime = ,,ms/s

#[proc-java]
#[proc-java-ext]

[proc-os-stats]
kernel.all.sysfork = ,,
proc.runq.runnable = ,,
proc.runq.blocked = ,,
proc.runq.sleeping = ,,
proc.runq.stopped = ,,
proc.runq.swapped = ,,
proc.runq.defunct = ,,
proc.runq.unknown = ,,
proc.runq.kernel = ,,
