CLI Sensor Language

The cms_perf executable supports configuring each load sensor via the CLI. This allows to parse mathematical expressions including the actual system sensors to calculate the final reading.

# allow 10x load per core than usual
cms_perf --runq=100.0*loadq/10/ncores

Load Sensors

The cms_perf provides five sensor readings as percentages, which can be customized individually. By default, they express the canonical cms.perf readings:

--prunq=100.0*loadq/ncores

Expression to compute system load percentage [default: %(default)s]

--pcpu=pcpu

Expression to compute cpu utilization percentage [default: %(default)s]

--pmem=pmem

Expression to compute memory utilization percentage [default: %(default)s]

--ppag=0

Expression to compute paging load percentage [default: %(default)s]

--pio=pio

Expression to compute network utilization percentage [default: %(default)s]

Each canonical sensor reading is available in sensor expressions with its canonical name. For example, prunq always refers to the default definition of --prunq.

Sensor Expressions

Each sensor can be reconfigured by supplying an expression to compute it. Expressions use a simple language, which consists of

  • float operators *, /, +, - and parentheses,

  • function calls with and without arguments, and

  • constants such as numbers and enums.

Constant Literals

Number literals are decimals, with optional sign and fractional part. For example, this includes 12, -1.2, and 12..

Enum literals are plain names, and only allowed in functions that expect them. For example, ncores allows ncores(all) and ncores(physical), but not ncores(inet6) nor ncores("all").

Functions Calls

Various functions are built-in for use in sensor expressions. Some of these are actual system sensors, collecting data from the system, others are helpers to transform data, such as taking the maximum of several data points. There are two ways to use functions in expressions: using just the bare name to invoke default arguments, or using the name followed by parenthesised arguments.

# allow 10x load per all cores than usual
cms_perf --runq=100.0*loadq/10/ncores

Available Functions

loadq

Absolute system load, the number of active processes

max(a, b, others...)

The maximum value of all arguments

min(a, b, others...)

The minimum value of all arguments

ncores or ncores(kind)

Number of CPU cores, by default including logical cores as well

kind selects which cores to count, and may one of all or physical. It defaults to all.

nsockets or nsockets(kind)

Number of open sockets across all processes

kind selects which sockets to count, and may be one of inet, inet4, inet6, tcp, tcp4, tcp6, udp, udp4, udp6, unix or all. It defaults to tcp.

pcpu

Percentage of cpu utilisation

pio

Percentage of network I/O utilisation

pmem

Percentage of memory utilisation

prunq

Percentage of system load per core

xrd.nfds

Number of file descriptors by all XRootD processes

xrd.nthreads

Number of threads by all XRootD processes

xrd.piowait

Percentage of time waiting for IO by all XRootD processes