MinMax takes incoming data from a data source (a topic), and generates some statistics on them like minimum, maximum, average, ... values.
MinMax 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 MinMax. If not set, uses the filename.
-->> name=toto
Remove some trace. This option is useful to avoid logging of very noisy topics.
This MinMax starts as disabled : stats change and incoming messages are ignored.
None
- MAJORDOME_Myself is automatically created and correspond to the current MinMax
- MAJORDOME_MINMAX - minmax's name
Statistics sequencing and retrieving are done through the MajordomeMinMax's API :
getContainer()
returns the container (directory) in which this MinMax has been definedgetName()
returns MinMax's nameisEnabled()
returns a boolean reflecting if this MinMax is enabled or notEnable()
to enable this MinMaxDisable()
to disable this MinMaxClear()
orReset()
to reset data statistics : a new collection is startinggetMin()
,getMax()
,getAverage()
: some statisticsgetSum()
: sum of all incoming data since lastReset()
getSamplesNumber()
: number of samples received since lastReset()