diff --git a/Documentations/NamedMinMax.md b/Documentations/NamedMinMax.md new file mode 100644 index 0000000..0cd32d7 --- /dev/null +++ b/Documentations/NamedMinMax.md @@ -0,0 +1,43 @@ +# .namedminmax +NamedMinMax generates some statistics from several named dataset (instead of only one as [MinMax](MinMax.md) is doing). + +## Syntax + +NamedMinMax are basically **[Lua tasks](Task(lua).md)** and are following the same syntax. + +In the header of the script (comment block at the very beginning of the script), each line starting with `-->>` are Majordome's commands.
+Consequently, `--->>` are commented out commands (notice the 3 dashes). + +## Directives + +### Generals + +#### -->> name= +Unique name to identify the NamedMinMax. If not set, uses the filename. +`-->> name=toto` +#### -->> quiet +Remove some trace. This option is useful to avoid logging of very noisy topics. + +#### -->> disabled +This NamedMinMax starts as disabled : stats change and incoming messages are ignored. + +### NamedMinMax owns +None + +### Exposed variables +- **MAJORDOME_Myself** is automatically created and correspond to the current NamedMinMax +- **MAJORDOME_NAMEDMINMAX** - NamedMinMax's name + +## at Lua side +### Exposed objects +Statistics sequencing and retrieving are done through the **MajordomeNamedMinMax**'s API : +- `getContainer()` returns the container (directory) in which this NamedMinMax has been defined +- `getName()` returns NamedMinMax's name +- `isEnabled()` returns a boolean reflecting if this NamedMinMax is enabled or not +- `Enable()` to enable this NamedMinMax +- `Disable()` to disable this NamedMinMax +- `Clear(name)` or `Reset(name)` to reset data statistics : a new collection is starting (only impacting the one the name is provided) +- `getMin(name)`, `getMax(name)`, `getAverage(name)` : some statistics +- `getSum(name)` : sum of all incoming data since last `Reset()` +- `getSamplesNumber(name)` : number of samples received since last `Reset()` +- `FiguresNames()` : return all figures name's