#
# 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


#
# NUMA related metricsets
#
[numa-hint-faults]
header = yes
unitinfo = no
globals = no
timestamp = yes
width = 15
precision = 2
delimiter = " "
repeat_header = auto
mem.vmstat.numa_hint_faults       = faults/s,,,,
mem.vmstat.numa_hint_faults_local = faults_local/s,,,,
local                             = mem.vmstat.numa_hint_faults_local_percent
local.label                       = %%local
local.formula                     =
  100 *
  (
    rate(mem.vmstat.numa_hint_faults)
    ?
      rate(mem.vmstat.numa_hint_faults_local) / rate(mem.vmstat.numa_hint_faults)
    :
      mkconst(1, type=double, semantics=instant)
  )
local.width                       = 7
faults_remote                     = mem.vmstat.numa_hint_faults_remote
faults_remote.label               = faults_remote/s
faults_remote.formula             = mem.vmstat.numa_hint_faults - mem.vmstat.numa_hint_faults_local
remote                            = mem.vmstat.numa_hint_faults_remote_percent
remote.label                      = %%remote
remote.formula                    =
  100 *
  (
    rate(mem.vmstat.numa_hint_faults)
    ?
      (1 - rate(mem.vmstat.numa_hint_faults_local) / rate(mem.vmstat.numa_hint_faults))
    :
      mkconst(0, type=double, semantics=instant)
  )
remote.width                      = 7

[numa-per-node-cpu]
header = yes
unitinfo = no
globals = no
timestamp = yes
width = 9
precision = 2
delimiter = " "
repeat_header = auto
colxrow = "   NUMA n"
nusr            = %%usr,,s,,
nusr.formula    = 100 * kernel.pernode.cpu.vuser      / (hinv.ncpu / hinv.nnode)
nnice           = %%nice,,s,,
nnice.formula   = 100 * kernel.pernode.cpu.vnice      / (hinv.ncpu / hinv.nnode)
nsys            = %%sys,,s,,
nsys.formula    = 100 * kernel.pernode.cpu.sys        / (hinv.ncpu / hinv.nnode)
niowait         = %%iowait,,s,,
niowait.formula = 100 * kernel.pernode.cpu.wait.total / (hinv.ncpu / hinv.nnode)
nsteal          = %%steal,,s,,
nsteal.formula  = 100 * kernel.pernode.cpu.steal      / (hinv.ncpu / hinv.nnode)
nirq            = %%irq,,s,,
nirq.formula    = 100 * kernel.pernode.cpu.irq.hard   / (hinv.ncpu / hinv.nnode)
nsoft           = %%soft,,s,,
nsoft.formula   = 100 * kernel.pernode.cpu.irq.soft   / (hinv.ncpu / hinv.nnode)
nguest          = %%guest,,s,,
nguest.formula  = 100 * kernel.pernode.cpu.guest      / (hinv.ncpu / hinv.nnode)
ngnice          = %%gnice,,s,,
ngnice.formula  = 100 * kernel.pernode.cpu.guest_nice / (hinv.ncpu / hinv.nnode)
nidle           = %%idle,,s,,
nidle.formula   = 100 * kernel.pernode.cpu.idle       / (hinv.ncpu / hinv.nnode)

[numa-pgmigrate-per-node]
header = yes
unitinfo = no
globals = no
timestamp = yes
width = 15
precision = 3
delimiter = " "
repeat_header = auto
node_bw              = mem.vmstat.numa_bandwidth
node_bw.label        = MB/s/node
node_bw.formula      =
  rate(mem.vmstat.numa_pages_migrated) *
  hinv.pagesize / hinv.nnode / mkconst(1000000, type=double, semantics=instant)
node_pg              = mem.vmstat.numa_pages
node_pg.label        = auto pg/s/node
node_pg.formula      = rate(mem.vmstat.numa_pages_migrated) / hinv.nnode
node_succ_pg         = mem.vmstat.numa_pgmigrate_success
node_succ_pg.label   = success/s/node
node_succ_pg.formula = rate(mem.vmstat.pgmigrate_success) / hinv.nnode
node_fail_pg         = mem.vmstat.numa_pgmigrate_fail
node_fail_pg.label   = fail/s/node
node_fail_pg.formula = rate(mem.vmstat.pgmigrate_fail) / hinv.nnode
