Skip to content

Streamlets

Ioannis Charalampidis edited this page May 13, 2016 · 2 revisions

Another powerful feature of roBob are the streamlets. They are re-usable script fragments that run in parallel with the main application in order to collect auxiliary information.

For example, you can run uptime while your application is running in order to measure the system load while your application is running. In a similar manner you could run free in order to monitor the evolution of the memory usage.

Defining

A streamlet is defined in the streamlets configuration section and it has the following basic syntax:

streamlets:
   - name: my_streamlet
     parser: my_streamlet_parser
     script: |
        while true; do
           # Collect the metric and echo it's measurement
           uptime
           # Add some delay
           sleep 1
        done

The contents of the script property is a bash code fragment that should write on STDOUT it's measurements. These measurements are parsed by the parser defined and made available to the test results.

Using

To use a streamlet you need first load it and then use it in your stream like so:

load:
  - path/to/my_streamlet.yaml

streams:
  - ...
    streamlets:
      - name: my_streamlet
        alias:
          streamlet_metric: my_metric

Clone this wiki locally