Adds a "Last Value" column and calculates it. It also gets and saves the last value.
~This first pass has sqlite "hardcoded" but am working on a way to abstract the storage.~
For now, a sqlite plugin can be used to store historic runs. This can be configured easily.
Threshold Types
There are three threshold types:
number A regular number, like a score or simple number of documents.
percentage A percentage, like % source is unused.
size A file/directory size, like 12 KB.
Thresholds also can be upper or lower thresholds. If is an upper threshold, the value cannot exceed but can be equal. If is a lower threshold, the value cannot be below but can be equal.
failOnBreach Defaults to false where the gimbal run doesn't fail but allows the output to show a warning. Set to true to also fail the run.
saveOnlyOnSuccess Defaults to true to only save the gimbal run on success to keep only successful reports saved.
thresholds.diffPercentage If the other thresholds succeed, the % of the diff vs the last value is checked against this.
thresholds.number Defaults to 1 to allow a +/- 1 difference on number values.
thresholds.percentage Defaults to 1 to allow a +/- 1% difference on percentage values.
thresholds.size Defaults to 1000 to allow a +/- 1,000 B difference on size values.
Storage
To enable storage, the last-value plugin fires two events: plugin/last-value/report/get & plugin/last-value/report/save. Both get the command name and the save gets the report. If is not the first save, the report items will have the last value, raw last value, the diff and the change (number 0-100 for percentage). This allows to add another plugin that can listen to these events.
Right now, the sqlite plugin has a lastValue config that will enable supporting the last-value plugin events. A sample .gimbalrc.yml would be:
Adds a "Last Value" column and calculates it. It also gets and saves the last value.
~This first pass has sqlite "hardcoded" but am working on a way to abstract the storage.~
For now, a sqlite plugin can be used to store historic runs. This can be configured easily.
Threshold Types
There are three threshold types:
Thresholds also can be upper or lower thresholds. If is an upper threshold, the value cannot exceed but can be equal. If is a lower threshold, the value cannot be below but can be equal.
Config
failOnBreach
Defaults tofalse
where the gimbal run doesn't fail but allows the output to show a warning. Set totrue
to also fail the run.saveOnlyOnSuccess
Defaults totrue
to only save the gimbal run on success to keep only successful reports saved.thresholds.diffPercentage
If the other thresholds succeed, the % of the diff vs the last value is checked against this.thresholds.number
Defaults to1
to allow a +/- 1 difference on number values.thresholds.percentage
Defaults to1
to allow a +/- 1% difference on percentage values.thresholds.size
Defaults to1000
to allow a +/- 1,000 B difference on size values.Storage
To enable storage, the
last-value
plugin fires two events:plugin/last-value/report/get
&plugin/last-value/report/save
. Both get thecommand
name and the save gets the report. If is not the first save, the report items will have the last value, raw last value, the diff and the change (number 0-100 for percentage). This allows to add another plugin that can listen to these events.Right now, the
sqlite
plugin has alastValue
config that will enable supporting thelast-value
plugin events. A sample.gimbalrc.yml
would be:Screenshots
Would present as a warning if over threshold
Would fail if over threshold and
failOnBreach
is set totrue
Success if the item changed but under the threshold