Commit 02572929 authored by Otto Jonassen Wittner's avatar Otto Jonassen Wittner
Browse files

Added es index names in configfile + code to adopt name from file

parent a0b97449
Pipeline #51641 passed with stages
in 52 seconds
...@@ -10,6 +10,7 @@ dragonlab: ...@@ -10,6 +10,7 @@ dragonlab:
# Event types for variant # Event types for variant
gapsum: gapsum:
title: "Gap summary" title: "Gap summary"
index: "dragonlab"
default_field: "down_ppm" # Data field to select as default default_field: "down_ppm" # Data field to select as default
# Relevant data fields for event type (matches ES field names) # Relevant data fields for event type (matches ES field names)
field: field:
...@@ -55,6 +56,7 @@ dragonlab: ...@@ -55,6 +56,7 @@ dragonlab:
aggr: "sum" aggr: "sum"
gap: gap:
title: "Gaps" title: "Gaps"
index: "dragonlab"
field: field:
down_ppm: down_ppm:
title: "Unavailability" title: "Unavailability"
...@@ -89,6 +91,7 @@ dragonlab: ...@@ -89,6 +91,7 @@ dragonlab:
default_field: "down_ppm" default_field: "down_ppm"
jitter: jitter:
title: "Queues" title: "Queues"
index: "dragonlab_jitter"
default_field: "h_ddelay" default_field: "h_ddelay"
field: field:
h_ddelay: h_ddelay:
...@@ -113,6 +116,7 @@ dragonlab: ...@@ -113,6 +116,7 @@ dragonlab:
aggr: "avg" aggr: "avg"
routesum: routesum:
title: "Route summary" title: "Route summary"
index: "dragonlab_routemon"
default_field: "routes_failed" default_field: "routes_failed"
field: field:
routes_failed: routes_failed:
...@@ -154,6 +158,7 @@ dragonlab: ...@@ -154,6 +158,7 @@ dragonlab:
aggr: "max" aggr: "max"
routeerr: routeerr:
title: "Route errors" title: "Route errors"
index: "dragonlab_routemon"
default_field: "anomaly_count" default_field: "anomaly_count"
field: field:
anomaly_count: anomaly_count:
...@@ -192,6 +197,7 @@ dragonlab: ...@@ -192,6 +197,7 @@ dragonlab:
aggr: "" aggr: ""
routechange: routechange:
title: "Route changes" title: "Route changes"
index: "dragonlab_routemon"
default_field: "no_hops_over_ce_limit" default_field: "no_hops_over_ce_limit"
field: field:
anomality_class: anomality_class:
...@@ -244,6 +250,7 @@ uninett: ...@@ -244,6 +250,7 @@ uninett:
# Event types for variant # Event types for variant
gapsum: gapsum:
title: "Gap summary" title: "Gap summary"
index: "uninett"
default_field: "down_ppm" # Data field to select as default default_field: "down_ppm" # Data field to select as default
# Relevant data fields for event type (matches ES field names) # Relevant data fields for event type (matches ES field names)
field: field:
...@@ -289,6 +296,7 @@ uninett: ...@@ -289,6 +296,7 @@ uninett:
aggr: "sum" aggr: "sum"
gap: gap:
title: "Gaps" title: "Gaps"
index: "uninett"
field: field:
down_ppm: down_ppm:
title: "Unavailability" title: "Unavailability"
...@@ -323,6 +331,7 @@ uninett: ...@@ -323,6 +331,7 @@ uninett:
default_field: "down_ppm" default_field: "down_ppm"
jitter: jitter:
title: "Queues" title: "Queues"
index: "uninett_jitter"
default_field: "h_ddelay" default_field: "h_ddelay"
field: field:
h_ddelay: h_ddelay:
......
...@@ -210,6 +210,7 @@ var no_coords= new LatLon(70.98584, -8.49243); // Jan Mayen ...@@ -210,6 +210,7 @@ var no_coords= new LatLon(70.98584, -8.49243); // Jan Mayen
var points=[]; var points=[];
var empty_color="LightGray"; var empty_color="LightGray";
var event_index = {}
var prop_names_list = { var prop_names_list = {
gapsum: "down_ppm h_ddelay h_jit h_min_d big_gaps big_time small_gaps small_time".split(" "), gapsum: "down_ppm h_ddelay h_jit h_min_d big_gaps big_time small_gaps small_time".split(" "),
gap: "down_ppm tloss h_ddelay h_jit h_min_d h_slope_10".split(" "), gap: "down_ppm tloss h_ddelay h_jit h_min_d h_slope_10".split(" "),
...@@ -260,9 +261,11 @@ var points_cache=[]; ...@@ -260,9 +261,11 @@ var points_cache=[];
prop_names_list ={}; prop_names_list ={};
prop_desc ={}; prop_desc ={};
event_desc={}; event_desc={};
event_index={};
for (const e in conffile[parms.net].event_type) { for (const e in conffile[parms.net].event_type) {
prop_names_list[e]=[]; prop_names_list[e]=[];
event_desc[e] = conffile[parms.net].event_type[e].title event_desc[e] = conffile[parms.net].event_type[e].title
event_index[e] = conffile[parms.net].event_type[e].index
for (const f in conffile[parms.net].event_type[e].field) { for (const f in conffile[parms.net].event_type[e].field) {
// Add only numeric properties/variables // Add only numeric properties/variables
if (conffile[parms.net].event_type[e].field[f].type == "number") { if (conffile[parms.net].event_type[e].field[f].type == "number") {
...@@ -1765,6 +1768,10 @@ function get_connections(){ ...@@ -1765,6 +1768,10 @@ function get_connections(){
//links=[]; //links=[];
var index=parms.net; var index=parms.net;
var etype= $("#event_type").val(); var etype= $("#event_type").val();
if ( ! jQuery.isEmptyObject(event_index)) {
// Apply ES indexname from config file
index = event_index[parms.event];
} else
if ( etype === "gap" || etype === "gapsum" ) if ( etype === "gap" || etype === "gapsum" )
; ;
else if ( etype === "routeerr" || etype === "routesum" ) else if ( etype === "routeerr" || etype === "routesum" )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment