@cryptotaxi247 / netdata-1 / commits / ffc638457

alarms are now rendered in the order they are executed by netdata

Costa Tsaousis (ktsaou) committed Sep 16, 2016 at 00:02 UTC ffc63845782bb4791c51294d8489f769eeaf3b81
2 files changed +3 -3
src/health.c
+2
@@ -1825,6 +1825,7 @@ void health_alarm_log2json(RRDHOST *host, BUFFER *wb, uint32_t after) {
1825 static inline void health_rrdcalc2json_nolock(BUFFER *wb, RRDCALC *rc) {
1826 buffer_sprintf(wb,
1827 "\t\t\"%s.%s\": {\n"
1828 + "\t\t\t\"id\": %lu,\n"
1829 "\t\t\t\"name\": \"%s\",\n"
1830 "\t\t\t\"chart\": \"%s\",\n"
1831 "\t\t\t\"family\": \"%s\",\n"
@@ -1846,6 +1847,7 @@ static inline void health_rrdcalc2json_nolock(BUFFER *wb, RRDCALC *rc) {
1847 "\t\t\t\"delay\": %d,\n"
1848 "\t\t\t\"delay_up_to_timestamp\": %lu,\n"
1849 , rc->chart, rc->name
1850 + , (unsigned long)rc->id
1851 , rc->name
1852 , rc->chart
1853 , (rc->rrdset && rc->rrdset->family)?rc->rrdset->family:""
web/index.html
+1 -3
@@ -2791,15 +2791,13 @@ function alarmsUpdateModal() {
2791 if(chart.priority < families[family].priority)
2792 families[family].priority = chart.priority;
2793
2794 - families[family].arr.push(alarm);
2794 + families[family].arr.unshift(alarm);
2795 }
2796
2797 // sort the families, like the dashboard menu does
2798 var families_sorted = families_sort.sort(function (a, b) {
2799 if (a.priority > b.priority) return -1;
2800 if (a.priority < b.priority) return 1;
2801 - if (a.id > b.id) return 1;
2802 - if (a.id < b.id) return -1;
2801 return 0;
2802 });
2803