Examples
banshee/examples-collection/examples/mechanics/
selection
Example: per and its default selection, all but ignore; the space used per file system.
by banshee1 installation2 versions
v2Latest
Published on October 28, 2026. One naming convention across collections; documentation completed.
Selection: per and ignore
per makes a collector return one value per element, here per file system, and sets the default selection of the probe: all of them, except those that match a pattern of ignore.
How to read it
per('filesystem', 'File systems', array('ignore' => array('/boot*', '/snap/*'))): the name of the elements, the word the screen shows for them (plural), and the patterns left out by default. A collector declares oneperat most.'per' => 'filesystem'on an output: its value is returned once per element,value('used-percent', …, $f[5]), the third argument naming the element, here the mount point.- The code never filters on the selection: it returns every file system that is a disk, leaving out only those in memory (
tmpfs,devtmpfs) and those of size zero. The poller sets aside, before judging, what the selection of the probe leaves out. The administrator changes the selection on the probe: all, all except, or only. - A pattern follows
text.like:*any characters,?one, the rest itself, case counting. - Leaving out
tmpfsin the code is not a selection: those are not disks at all.
To adapt it
onlyinstead ofignoremakes the default "only these" (seeexamples/mechanics/selection-only).- Without options, the default is all.