Add time/times to alarm def creation

Change-Id: I66affefab3f8a95452a4fb724da3870e5928d3ce
This commit is contained in:
Adrian Czarnecki 2021-10-29 06:45:29 -07:00
parent 99591546cf
commit 1ce80db6e0
8 changed files with 86 additions and 26 deletions

View File

@ -4,12 +4,15 @@
<div class="clearfix">
<p class="text-info">
{% blocktrans %}
Each alarm definition is defined by its expression composed out of:
mathematical function, metric, threshold and comparator for metric's
value and the threshold. Additionally it is possible to narrow
evaluation of the alarm to certain entities by choosing their
dimensions. The deterministic alarms never enter UNDETERMINED state.
Use them for metrics that are received sporadically.
Each alarm definition is defined by its expression composed out of
mathematical function, metric, time, times ,threshold and comparator for
metric's value and the threshold. Time is the number of seconds for the measurement
to be done. They can only be in a multiple of 60. Times is how many times in a row
that expression must be true before triggering the alarm. Both time and times are
optional and default to 60 and 1 respectively. Additionally it is possible to narrow
evaluation of the alarm to certain entities by choosing their
dimensions. The deterministic alarms never enter UNDETERMINED state.
Use them for metrics that are received sporadically.
{% endblocktrans %}
</p>
</div>

View File

@ -29,9 +29,11 @@ msgstr ""
msgid ""
"\n"
" Each alarm definition is defined by its expression composed out of:\n"
" mathematical function, metric, threshold and comparator for "
"metric's\n"
" value and the threshold. Additionally it is possible to narrow\n"
" mathematical function, metric, time, times ,threshold and comparator for \n"
" metric's value and the threshold. Time is the number of seconds for the measurement \n"
" to be done. They can only be in a multiple of 60. Times is how many times in a row \n"
" that expression must be true before triggering the alarm. Both time and times are
" optional and default to 60 and 1 respectively. Additionally it is possible to narrow\n"
" evaluation of the alarm to certain entities by choosing their\n"
" dimensions. The deterministic alarms never enter UNDETERMINED "
"state.\n"
@ -40,9 +42,11 @@ msgid ""
msgstr ""
"\n"
" Each alarm definition is defined by its expression composed out of:\n"
" mathematical function, metric, threshold and comparator for "
"metric's\n"
" value and the threshold. Additionally it is possible to narrow\n"
" mathematical function, metric, time, times ,threshold and comparator for \n"
" metric's value and the threshold. Time is the number of seconds for the measurement \n"
" to be done. They can only be in a multiple of 60. Times is how many times in a row \n"
" that expression must be true before triggering the alarm. Both time and times are
" optional and default to 60 and 1 respectively. Additionally it is possible to narrow\n"
" evaluation of the alarm to certain entities by choosing their\n"
" dimensions. The deterministic alarms never enter UNDETERMINED "
"state.\n"

View File

@ -56,6 +56,12 @@ msgstr "Submit"
msgid "Threshold"
msgstr "Threshold"
msgid "Time"
msgstr "Time"
msgid "Times"
msgstr "Times"
msgid "Up"
msgstr "Up"

View File

@ -23,16 +23,18 @@ msgstr ""
"Name field digunakan untuk mengidentifikasi definisi alarm. "
msgid ""
"\n"
" Each alarm definition is defined by its expression composed out of:\n"
" mathematical function, metric, threshold and comparator for "
"metric's\n"
" value and the threshold. Additionally it is possible to narrow\n"
" mathematical function, metric, time, times ,threshold and comparator for \n"
" metric's value and the threshold. Time is the number of seconds for the measurement \n"
" to be done. They can only be in a multiple of 60. Times is how many times in a row \n"
" that expression must be true before triggering the alarm. Both time and times are
" optional and default to 60 and 1 respectively. Additionally it is possible to narrow\n"
" evaluation of the alarm to certain entities by choosing their\n"
" dimensions. The deterministic alarms never enter UNDETERMINED "
"state.\n"
" Use them for metrics that are received sporadically.\n"
" "
msgstr ""
"\n"
"Setiap definisi alarm didefinisikan oleh ekspresinya yang terdiri dari:\n"

View File

@ -32,14 +32,17 @@ msgstr ""
msgid ""
"\n"
" Each alarm definition is defined by its expression composed out of:\n"
" mathematical function, metric, threshold and comparator for "
"metric's\n"
" value and the threshold. Additionally it is possible to narrow\n"
" mathematical function, metric, time, times ,threshold and comparator for \n"
" metric's value and the threshold. Time is the number of seconds for the measurement \n"
" to be done. They can only be in a multiple of 60. Times is how many times in a row \n"
" that expression must be true before triggering the alarm. Both time and times are
" optional and default to 60 and 1 respectively. Additionally it is possible to narrow\n"
" evaluation of the alarm to certain entities by choosing their\n"
" dimensions. The deterministic alarms never enter UNDETERMINED "
"state.\n"
" Use them for metrics that are received sporadically.\n"
" "
msgstr ""
"\n"
" アラーム定義は数学関数、メトリック、閾値、比較演算子によって定義され"

View File

@ -28,9 +28,11 @@ msgstr ""
msgid ""
"\n"
" Each alarm definition is defined by its expression composed out of:\n"
" mathematical function, metric, threshold and comparator for "
"metric's\n"
" value and the threshold. Additionally it is possible to narrow\n"
" mathematical function, metric, time, times ,threshold and comparator for \n"
" metric's value and the threshold. Time is the number of seconds for the measurement \n"
" to be done. They can only be in a multiple of 60. Times is how many times in a row \n"
" that expression must be true before triggering the alarm. Both time and times are
" optional and default to 60 and 1 respectively. Additionally it is possible to narrow\n"
" evaluation of the alarm to certain entities by choosing their\n"
" dimensions. The deterministic alarms never enter UNDETERMINED "
"state.\n"

View File

@ -18,6 +18,7 @@ angular
.module('monitoring.services', [])
.factory('monExpressionBuilder', expressionBuilder);
function expressionBuilder() {
return {
@ -28,7 +29,6 @@ function expressionBuilder() {
function subExpressionToString(subExpressions, withOp) {
var tmp = [],
exprAsStr;
angular.forEach(subExpressions, function(expr) {
exprAsStr = [
withOp ? renderOp(expr) : '',
@ -36,9 +36,13 @@ function expressionBuilder() {
expr.fun && '(',
expr.metric ? expr.metric.name : '', renderDimensions(expr),
(expr.deterministic ? ',deterministic': ''),
expr.time && ',',
expr.time || ',60',
expr.fun && ')',
expr.cmp || '',
expr.threshold === 0 ? 0 : expr.threshold || ''
expr.threshold === 0 ? 0 : expr.threshold || '',
expr.times && ' times ',
expr.times || ' times 1',
].join('');
tmp.push(exprAsStr);
});

View File

@ -3,7 +3,6 @@
</div>
<form name="subExpressionForm" ng-if="!vm.preview" novalidate>
<div class="row expression-details" ng-if="vm.connectable">
<div class="col-md-2 col-xs-6">
<label class="control-label" for="expressionOperator">
@ -98,8 +97,45 @@
ng-class="{'has-error': subExpressionForm.threshold.$invalid && !subExpressionForm.$pristine}"
aria-describedby="helpBlock"/>
</div>
<div class="col-md-2 col-xs-6">
<label class="control-label" for="expressionFunction">
<span class="field-label">{{ 'Time'|translate }}</span>
<span class="hz-icon-required fa fa-asterisk"></span>
</label>
<input id="expressionTime"
name="expressionTime"
type="number"
step="any"
class="form-control input-sm"
aria-label="{$ 'Time'|translate $}"
title="{$ 'Time'|translate $}"
placeholder="60"
min="60"
ng-change="vm.updateExpression()"
ng-model="vm.model.time"
ng-class="{'has-error': subExpressionForm.time.$invalid && !subExpressionForm.$pristine}"
aria-describedby="helpBlock"/>
</div>
<div class="col-md-2 col-xs-6">
<label class="control-label" for="expressionFunction">
<span class="field-label">{{ 'Times'|translate }}</span>
<span class="hz-icon-required fa fa-asterisk"></span>
</label>
<input id="expressionTimes"
name="expressionTimes"
type="number"
step="any"
class="form-control input-sm"
aria-label="{$ 'Times'|translate $}"
title="{$ 'Times'|translate $}"
placeholder="1"
min="1"
ng-change="vm.updateExpression()"
ng-model="vm.model.times"
ng-class="{'has-error': subExpressionForm.times.$invalid && !subExpressionForm.$pristine}"
aria-describedby="helpBlock"/>
</div>
</div>
<div class="row expression-details">
<div class="col-md-9 col-xs-9">
<tags-input id="dimension-chooser"