From 0d7b7123b6e420bebfa4ac818410b64cf02c77df Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 31 Mar 2019 19:59:37 +0200 Subject: [PATCH] add example configurations for hooks --- etc/examples/hooks/average.conf | 17 +++++++++++++++ etc/examples/hooks/cast.conf | 20 +++++++++++++++++ etc/examples/hooks/decimate.conf | 16 ++++++++++++++ etc/examples/hooks/dp.conf | 24 +++++++++++++++++++++ etc/examples/hooks/dump.conf | 14 ++++++++++++ etc/examples/hooks/ebm.conf | 14 ++++++++++++ etc/examples/hooks/fix.conf | 14 ++++++++++++ etc/examples/hooks/jitter_calc.conf | 14 ++++++++++++ etc/examples/hooks/limit_rate.conf | 16 ++++++++++++++ etc/examples/hooks/print.conf | 18 ++++++++++++++++ etc/examples/hooks/restart.conf | 14 ++++++++++++ etc/examples/hooks/scale.conf | 17 +++++++++++++++ etc/examples/hooks/shift_seq.conf | 16 ++++++++++++++ etc/examples/hooks/shift_ts.conf | 16 ++++++++++++++ etc/examples/hooks/skip_first.conf | 17 +++++++++++++++ etc/examples/hooks/stats.conf | 17 +++++++++++++++ etc/examples/hooks/ts.conf | 14 ++++++++++++ etc/examples/paths.conf | 33 ----------------------------- 18 files changed, 278 insertions(+), 33 deletions(-) create mode 100644 etc/examples/hooks/average.conf create mode 100644 etc/examples/hooks/cast.conf create mode 100644 etc/examples/hooks/decimate.conf create mode 100644 etc/examples/hooks/dp.conf create mode 100644 etc/examples/hooks/dump.conf create mode 100644 etc/examples/hooks/ebm.conf create mode 100644 etc/examples/hooks/fix.conf create mode 100644 etc/examples/hooks/jitter_calc.conf create mode 100644 etc/examples/hooks/limit_rate.conf create mode 100644 etc/examples/hooks/print.conf create mode 100644 etc/examples/hooks/restart.conf create mode 100644 etc/examples/hooks/scale.conf create mode 100644 etc/examples/hooks/shift_seq.conf create mode 100644 etc/examples/hooks/shift_ts.conf create mode 100644 etc/examples/hooks/skip_first.conf create mode 100644 etc/examples/hooks/stats.conf create mode 100644 etc/examples/hooks/ts.conf diff --git a/etc/examples/hooks/average.conf b/etc/examples/hooks/average.conf new file mode 100644 index 000000000..fef760325 --- /dev/null +++ b/etc/examples/hooks/average.conf @@ -0,0 +1,17 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "average" + + signals = [ "sine", "square" ] + offset = 0 + } + ) + } +) diff --git a/etc/examples/hooks/cast.conf b/etc/examples/hooks/cast.conf new file mode 100644 index 000000000..6ad55a62c --- /dev/null +++ b/etc/examples/hooks/cast.conf @@ -0,0 +1,20 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "average" + + signal = "random" + + new_name = "int_random" + new_unit = "pts" + new_type = "integer" + } + ) + } +) diff --git a/etc/examples/hooks/decimate.conf b/etc/examples/hooks/decimate.conf new file mode 100644 index 000000000..aae8c69d9 --- /dev/null +++ b/etc/examples/hooks/decimate.conf @@ -0,0 +1,16 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "decimate" + + ratio = 10 + } + ) + } +) diff --git a/etc/examples/hooks/dp.conf b/etc/examples/hooks/dp.conf new file mode 100644 index 000000000..42df7d0bf --- /dev/null +++ b/etc/examples/hooks/dp.conf @@ -0,0 +1,24 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "dp" + + signal = "sine" + f0 = 50 # Hz + dt = 0.1 # seconds + + # Alternative to dt + # rate = 10 Hz + + harmonics = [ 0, 1, 3, 5, 7 ] + inverse = false + } + ) + } +) diff --git a/etc/examples/hooks/dump.conf b/etc/examples/hooks/dump.conf new file mode 100644 index 000000000..1aa1a03a9 --- /dev/null +++ b/etc/examples/hooks/dump.conf @@ -0,0 +1,14 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "dump" + } + ) + } +) diff --git a/etc/examples/hooks/ebm.conf b/etc/examples/hooks/ebm.conf new file mode 100644 index 000000000..bf2c2efb8 --- /dev/null +++ b/etc/examples/hooks/ebm.conf @@ -0,0 +1,14 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "ebm" + } + ) + } +) diff --git a/etc/examples/hooks/fix.conf b/etc/examples/hooks/fix.conf new file mode 100644 index 000000000..f357b7a92 --- /dev/null +++ b/etc/examples/hooks/fix.conf @@ -0,0 +1,14 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "fix" + } + ) + } +) diff --git a/etc/examples/hooks/jitter_calc.conf b/etc/examples/hooks/jitter_calc.conf new file mode 100644 index 000000000..2ff49f622 --- /dev/null +++ b/etc/examples/hooks/jitter_calc.conf @@ -0,0 +1,14 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "jitter_calc" + } + ) + } +) diff --git a/etc/examples/hooks/limit_rate.conf b/etc/examples/hooks/limit_rate.conf new file mode 100644 index 000000000..9eb2f0759 --- /dev/null +++ b/etc/examples/hooks/limit_rate.conf @@ -0,0 +1,16 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "limit_rate" + + rate = 5.5 + } + ) + } +) diff --git a/etc/examples/hooks/print.conf b/etc/examples/hooks/print.conf new file mode 100644 index 000000000..220e7ad16 --- /dev/null +++ b/etc/examples/hooks/print.conf @@ -0,0 +1,18 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "print", + + output = "print_output_file.log" + format = "villas.human" + prefix = "[file_node] " + } + ) + } +) diff --git a/etc/examples/hooks/restart.conf b/etc/examples/hooks/restart.conf new file mode 100644 index 000000000..7293a0601 --- /dev/null +++ b/etc/examples/hooks/restart.conf @@ -0,0 +1,14 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "restart" + } + ) + } +) diff --git a/etc/examples/hooks/scale.conf b/etc/examples/hooks/scale.conf new file mode 100644 index 000000000..73ead75fb --- /dev/null +++ b/etc/examples/hooks/scale.conf @@ -0,0 +1,17 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "scale" + + scale = 5.5 + offset = 1.2 + } + ) + } +) diff --git a/etc/examples/hooks/shift_seq.conf b/etc/examples/hooks/shift_seq.conf new file mode 100644 index 000000000..6cec96ba2 --- /dev/null +++ b/etc/examples/hooks/shift_seq.conf @@ -0,0 +1,16 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "shift_seq" + + offset = 10 + } + ) + } +) diff --git a/etc/examples/hooks/shift_ts.conf b/etc/examples/hooks/shift_ts.conf new file mode 100644 index 000000000..3ad73e760 --- /dev/null +++ b/etc/examples/hooks/shift_ts.conf @@ -0,0 +1,16 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "shift_ts" + + rate = 5.5 + } + ) + } +) diff --git a/etc/examples/hooks/skip_first.conf b/etc/examples/hooks/skip_first.conf new file mode 100644 index 000000000..2cffb84e2 --- /dev/null +++ b/etc/examples/hooks/skip_first.conf @@ -0,0 +1,17 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "skip_first" + + seconds = 10 + # sequence = 10 + } + ) + } +) diff --git a/etc/examples/hooks/stats.conf b/etc/examples/hooks/stats.conf new file mode 100644 index 000000000..e437b3f8d --- /dev/null +++ b/etc/examples/hooks/stats.conf @@ -0,0 +1,17 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "stats" + + verbose = true + warmup = 100 + } + ) + } +) diff --git a/etc/examples/hooks/ts.conf b/etc/examples/hooks/ts.conf new file mode 100644 index 000000000..540c20995 --- /dev/null +++ b/etc/examples/hooks/ts.conf @@ -0,0 +1,14 @@ +@include "../nodes/signal_generator.conf" + +paths = ( + { + in = "signal_node" + out = "signal_node" + + hooks = ( + { + type = "ts" + } + ) + } +) diff --git a/etc/examples/paths.conf b/etc/examples/paths.conf index 555ece6b2..189cd73e1 100644 --- a/etc/examples/paths.conf +++ b/etc/examples/paths.conf @@ -34,38 +34,5 @@ paths = ( builtin = false, # By default, all paths will have a few builtin hooks attached to them. # When collecting statistics or measurements these are undesired. - - # A complete list of supported hooks - - hooks = ( - { - type = "print" - - output = "stdout" - priority = 0 - }, - { - type = "ts" - - priority = 1 - }, - { - type = "decimate" - - ratio = 2 # Only forward every 2nd message - }, - { - type = "skip_first" - - seconds = 10 # Skip the first 10 seconds of this path - # samples = 1000 # Skip the first 1000 samples - }, - { - type = "shift" - - mode = "origin", # Shift origin timestam of samples by +10 seconds - offset = 10 # Seconds - } - ) } )