banshee is under active development: collectors will keep changing, and a version you publish will likely need adjustments. For stable use, wait for version 1.0.0.

Examples

banshee/examples-collection/examples/mechanics/

durations

Example: for, in passes and in time; the response time of a web page.

  • example
  • for
  • duration
  • watch
  • http

by banshee1 installation1 version

v1Latest

Published on October 27, 2026. First version in this collection.

Keen 1.0.0 · 19 lines
// Durations in for: a watch raises only when its condition holds for a while, counted in passes
// ('3 runs') or in time ('10 min'). Without for, the default '1 run', it raises at once.
// The collector reads the response time of a web page.
need('protocol:http');

$url = variable('example:page:url', 'text', array(
    'label' => 'Address of the page',
    'help'  => 'For example https://www.example/.',
));

output('response-time', 'number', array('label' => 'Response time', 'unit' => 'ms'));

// Slow for 3 passes in a row: a warning. One slow pass alone raises nothing.
watch.above('slow', 'Slow', 'response-time', array('warning' => 500, 'for' => '3 runs'));
// Very slow for 10 minutes: critical, whatever the interval of the probe.
watch.above('very-slow', 'Very slow', 'response-time', array('critical' => 2000, 'for' => '10 min'));

$answer = http.get($url);
value('response-time', $answer['time']);