Skip to content

Commit

Permalink
Add a merge unit. (#110)
Browse files Browse the repository at this point in the history
This PR adds a new merge unit that merges the payload from all its healthy
sources.
  • Loading branch information
partim committed Apr 29, 2024
1 parent 01cda62 commit bbcb3b0
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 84 deletions.
10 changes: 10 additions & 0 deletions doc/manual/source/manual-page.rst
Expand Up @@ -239,6 +239,16 @@ random
A boolean value specifying whether the unit should pick a source unit
at random. If the value is ``false`` or not given, the source units are
picked in the order given.

Merge Unit
----------

A unit of type ``"merge"`` will merge the data from all data sets of its
source units. It has the following configuration options:

sources
A list of strings each containing the name of a unit to use as a
source.


SLURM Unit
Expand Down
14 changes: 14 additions & 0 deletions etc/rtrtr.conf
Expand Up @@ -94,6 +94,12 @@ sources = [ "local-3323", "local-3324", "cloudflare-json" ]
random = false


# We can also merge the data from multiple sources
[units.merged-rtr]
type = "merge"
sources = [ "local-3323", "local-3324", "cloudflare-json" ]


# Local exceptions can be applied, too.
[units.slurm]
type = "slurm"
Expand All @@ -115,6 +121,14 @@ listen = [ "127.0.0.1:9001" ]
unit = "any-rtr"


# Let’s have a target for the merged data, too.
[targets.local-9002]
type = "rtr"
listen = [ "127.0.0.1:9002" ]
unit = "merged-rtr"


# We can also provide the data as JSON over HTTP.
[targets.http-json]
type = "http"
path = "/json"
Expand Down

0 comments on commit bbcb3b0

Please sign in to comment.