NamedMinMax generates some statistics from several named dataset (instead of only one as MinMax is doing).
NamedMinMax are basically Lua tasks 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).
Unique name to identify the NamedMinMax. If not set, uses the filename.
-->> name=toto
Remove some trace. This option is useful to avoid logging of very noisy topics.
This NamedMinMax starts as disabled : stats change and incoming messages are ignored.
None
- MAJORDOME_Myself is automatically created and correspond to the current NamedMinMax
- MAJORDOME_NAMEDMINMAX - NamedMinMax's name
The script is expected to return the name of the data to be store. Consequently, a single NamedMinMax can process several topics as shown in the provided example.
In addition, it can return a value which will replace the received one.
Statistics sequencing and retrieving are done through the MajordomeNamedMinMax's API :
getContainer()
returns the container (directory) in which this NamedMinMax has been definedgetName()
returns NamedMinMax's nameisEnabled()
returns a boolean reflecting if this NamedMinMax is enabled or notEnable()
to enable this NamedMinMaxDisable()
to disable this NamedMinMaxClear(name)
orReset(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 statisticsgetSum(name)
: sum of all incoming data since lastReset()
getSamplesNumber(name)
: number of samples received since lastReset()
FiguresNames()
: return all figures name's