diff --git a/monitoring/alarmdefs/templates/alarmdefs/_create_ad_expression_help.html b/monitoring/alarmdefs/templates/alarmdefs/_create_ad_expression_help.html
index 36db91e8..ae1f4c12 100644
--- a/monitoring/alarmdefs/templates/alarmdefs/_create_ad_expression_help.html
+++ b/monitoring/alarmdefs/templates/alarmdefs/_create_ad_expression_help.html
@@ -4,12 +4,15 @@
{% 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 %}
diff --git a/monitoring/locale/en_GB/LC_MESSAGES/django.po b/monitoring/locale/en_GB/LC_MESSAGES/django.po
index f6f0fe83..e35385c6 100644
--- a/monitoring/locale/en_GB/LC_MESSAGES/django.po
+++ b/monitoring/locale/en_GB/LC_MESSAGES/django.po
@@ -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"
diff --git a/monitoring/locale/en_GB/LC_MESSAGES/djangojs.po b/monitoring/locale/en_GB/LC_MESSAGES/djangojs.po
index 7d57ceff..2ada25a1 100644
--- a/monitoring/locale/en_GB/LC_MESSAGES/djangojs.po
+++ b/monitoring/locale/en_GB/LC_MESSAGES/djangojs.po
@@ -56,6 +56,12 @@ msgstr "Submit"
msgid "Threshold"
msgstr "Threshold"
+msgid "Time"
+msgstr "Time"
+
+msgid "Times"
+msgstr "Times"
+
msgid "Up"
msgstr "Up"
diff --git a/monitoring/locale/id/LC_MESSAGES/django.po b/monitoring/locale/id/LC_MESSAGES/django.po
index 3e14ba8d..a118a3c3 100644
--- a/monitoring/locale/id/LC_MESSAGES/django.po
+++ b/monitoring/locale/id/LC_MESSAGES/django.po
@@ -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"
diff --git a/monitoring/locale/ja/LC_MESSAGES/django.po b/monitoring/locale/ja/LC_MESSAGES/django.po
index 0438e140..8381f6fb 100644
--- a/monitoring/locale/ja/LC_MESSAGES/django.po
+++ b/monitoring/locale/ja/LC_MESSAGES/django.po
@@ -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"
" アラーム定義は数学関数、メトリック、閾値、比較演算子によって定義され"
diff --git a/monitoring/locale/ko_KR/LC_MESSAGES/django.po b/monitoring/locale/ko_KR/LC_MESSAGES/django.po
index d80cd5d7..31a41f6a 100644
--- a/monitoring/locale/ko_KR/LC_MESSAGES/django.po
+++ b/monitoring/locale/ko_KR/LC_MESSAGES/django.po
@@ -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"
diff --git a/monitoring/static/monitoring/js/services.js b/monitoring/static/monitoring/js/services.js
index 93c2c943..b856c714 100644
--- a/monitoring/static/monitoring/js/services.js
+++ b/monitoring/static/monitoring/js/services.js
@@ -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);
});
diff --git a/monitoring/static/monitoring/widgets/expression/sub-expression.tpl.html b/monitoring/static/monitoring/widgets/expression/sub-expression.tpl.html
index d114bba0..c140f351 100644
--- a/monitoring/static/monitoring/widgets/expression/sub-expression.tpl.html
+++ b/monitoring/static/monitoring/widgets/expression/sub-expression.tpl.html
@@ -3,7 +3,6 @@