Commit 0dda99b1 authored by Otto Jonassen Wittner's avatar Otto Jonassen Wittner
Browse files

Version 0.2 of config file. Property structures updated by config.

parent cdf06f14
Pipeline #50280 passed with stages
in 1 minute and 1 second
......@@ -5,56 +5,149 @@
dragonlab:
# Measuremet network/variant parameters
title: "Dragonlab"
types:
event_type:
# Event types for variant
gap_summary:
gapsum:
title: "Gap summary"
gaps:
# Relevant data field for event type (matches ES field names)
field:
down_ppm:
title: "Unavailability"
unit: "ppm"
h_ddelay:
title: "Queue"
unit: "ms"
h_jit:
title: "Jitter"
unit: "ms"
h_min_d:
title: "Min delay"
unit: "ms"
big_gaps:
title: "Avg delay"
unit: "ms"
big_time:
title: "Big gap time"
unit: "s"
small_gaps:
title: "Small gaps"
unit: "#"
small_time:
title: "Small gap time"
unit: "s"
# Data field to select as default
default_field: "down_ppm"
gap:
title: "Gaps"
# Relevant data field for event type
vars:
unavail:
title: "Unavaiability"
field:
down_ppm:
title: "Unavailability"
unit: "ppm"
time:
title: "Time lost (ms)"
tloss:
title: "Time lost"
unit: "ms"
es_field: "tloss"
queue:
h_ddelay:
title: "Queue"
unit: "ms"
es_field: "h_ddelay"
jitter:
h_jit:
title: "Jitter"
unit: "ms"
min_delay:
h_min_d:
title: "Min delay"
unit: "ms"
slope:
h_slope_10:
title: "Slope"
queues:
unit: ""
default_field: "down_ppm"
jitter:
title: "Queues"
route_summary:
field:
h_ddelay:
title: "Queue"
unit: "ms"
h_jit:
title: "Jitter"
unit: "ms"
h_min_d:
title: "Min delay"
unit: "ms"
h_slope_10:
title: "Slope"
unit: ""
default_field: "h_ddelay"
routesum:
title: "Route summary"
vars:
routes_analysed:
title: "Routes failed"
es_field: "routes_failed"
field:
routes_failed:
title: "Routes failed"
es_field: "routes_failed"
unit: "#"
routes_reached:
title: "Routes completed"
es_field: "routes_reached"
unit: "#"
scale: "reversed" # Large numbers are desirable
routes_analysed:
title: "Routes analysed"
unit: "#"
scale: "reversed" # Large numbers are desirable
min_length:
title: "Min length"
es_field: "min_length"
unit: "hops"
max_length:
title: "Max length"
es_field: "Max_length"
route_errors:
unit: "hops"
unique_hosts:
title: "Unique hosts"
unit: "#"
#unique_hosts_per_hop:
# title: "Hosts per hop"
# unit: ""
default_field: "routes_failed"
routeerr:
title: "Route errors"
field:
anomaly_count:
title: "Routes failed"
unit: "#"
duration:
title: "Route down times"
unit: "s"
last_hop:
title: "Last hop"
unit: "hop#"
descr: "Hop no of last host responding"
max_length:
title: "Normal length"
unit: "hops"
descr: "Maximum observed lenght of route to destination"
last_reply_from:
title: "Last host"
unit: ""
descr: "Address of last host responding"
icmp_errors:
title: "ICMP messages"
unit: ""
descr: "ICMP messages received from last host"
default_field: "anomaly_count"
routechange:
title: "Route changes"
field:
anomality_class:
title: "Status"
unit: ""
descr: "New or well known route"
ce_delta:
title: "Per hop anomaly"
unit: ""
descr: "Anomaly factors (delta cross entropy) per hop along route"
prev_normal:
title: "Changed from"
unit: ""
descr: "List of hosts in previous routes"
new_normal:
title: "Changed to"
unit: ""
descr: "List of hosts in latest routes"
default_field: "anomality_class"
uninett:
title: "Uninett"
......@@ -202,13 +202,15 @@ var no_coords= new LatLon(70.98584, -8.49243); // Jan Mayen
var points=[];
var empty_color="LightGray";
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(" "),
gap: "down_ppm tloss h_ddelay h_jit h_min_d h_slope_10".split(" "),
jitter: "h_ddelay h_jit h_min_d h_slope_10".split(" "),
routesum: "routes_failed routes_reached probes_stopped_at_last_hop probes_with_none_dst_last_hop routes_analysed routes_reached min_length max_length".split(" "),
routeerr: "anomaly_count duration last_hop last_reply_from icmp_errors".split(" ")
};
var event_names;
var event_desc={ gapsum: "Gap summary", gap: "Gaps", jitter: "Queues", routesum: "Route summary", routeerr: "Route errors"};
var prop_names;
var prop_desc= { down_ppm:"Unavailability (PPM)", h_ddelay:"Queue(ms)", h_jit:"Jitter(ms)",
h_min_d:"Min delay(ms)", h_delay:"Avg delay(ms)",
......@@ -241,6 +243,29 @@ var loads=0; // number of loaded point series
var duplines=[];
var points_cache=[];
function update_props(mvar) {
// Repopulate property structures based on given measuerment network variant and config file
if (jQuery.isEmptyObject(conffile)) {
// No config file data available
return
}
// Clear list first
prop_names_list ={};
prop_desc ={};
event_desc={};
for (const e in conffile[mvar].event_type) {
prop_names_list[e]=[];
event_desc[e] = conffile[mvar].event_type[e].title
for (const f in conffile[mvar].event_type[e].field) {
prop_names_list[e].push(f);
var unit = conffile[mvar].event_type[e].field[f].unit
var title = conffile[mvar].event_type[e].field[f].title
prop_desc[f] = title + ( unit ? " (" + unit + ")" : "") ;
}
}
}
// sorting table
function comparer(index) {
return function(a, b) {
......@@ -360,14 +385,16 @@ function removeParam(parameter){
return url;
}
function make_prop_select(id, names){
function make_prop_select(id, names, desc){
var selectList=document.getElementById(id);
selectList.options.length = 0; // remove previous
for (var i = 0; i < names.length; i++) {
var option = document.createElement("option");
option.value = names[i];
var text=prop_desc[names[i]];
//var text=prop_desc[names[i]];
var text=desc[names[i]];
if ( ! text ) text = names[i];
option.text = text;
selectList.appendChild(option);
......@@ -1796,17 +1823,21 @@ $(document).ready ( function(){
parms=get_parms( );
update_props(parms.net);
if ( parms.net){
$("#network").val(parms.net);
} else {
parms.net = $("#network").val();
}
event_names = Object.keys(prop_names_list);
make_prop_select("event_type", event_names, event_desc );
if (parms.event) $("#event_type").val(parms.event);
if (parms.period) $("#period").val(parms.period);
prop_names = prop_names_list[ $("#event_type").val() ];
make_prop_select("prop_select", prop_names );
make_prop_select("prop_select", prop_names, prop_desc );
$.ajaxSetup({
beforeSend:function(){
......@@ -1896,7 +1927,7 @@ $(document).ready ( function(){
links_on=true;
focus_node="";
prop_names = prop_names_list[ $("#event_type").val() ];
make_prop_select("prop_select", prop_names );
make_prop_select("prop_select", prop_names, prop_desc );
get_connections();
// document.location.href =
removeParam( 'node');
......@@ -1907,6 +1938,7 @@ $(document).ready ( function(){
// network change
$("#network").change( function(){
parms.net= $("#network").val();
update_props(parms.net);
remove_links(links);
load_name_to_address();
show_network(parms.net);
......@@ -1919,7 +1951,7 @@ $(document).ready ( function(){
prop_names = prop_names_list[ $("#event_type").val() ];
//remove_links();
prop_names = prop_names_list[ $("#event_type").val() ];
make_prop_select("prop_select", prop_names );
make_prop_select("prop_select", prop_names, prop_desc );
get_connections();
update_url();
});
......
Supports Markdown
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