Commit 502b87b9 authored by Otto Jonassen Wittner's avatar Otto Jonassen Wittner
Browse files

Added seach on ASN

parent eaa96f17
Pipeline #140976 passed with stages
in 1 minute
......@@ -625,6 +625,7 @@ dragonlab:
title: "Correlations"
index: "dragonlab_correvents_000001"
summary_event_type: "corrsum"
asn_source: "routechange_asn" # Field providing relevant as numbers
popup:
summary:
- corr_count
......@@ -637,8 +638,9 @@ dragonlab:
# - corr_count_uniq
- events_corr
- tloss
- ce_delta
default_summary_field: "corr_count_uniq"
- routechange_asn
#- ce_delta
default_summary_field: "tloss"
summary_field:
count:
title: "Correlations"
......@@ -718,6 +720,12 @@ dragonlab:
unit: "ms"
type: "number"
aggr: "sum"
routechange_asn:
title: "ASN of route changer"
unit: ""
descr: "ASN of routers responisble for route change"
type: "string"
aggr: ""
uninett:
title: "Uninett"
......
......@@ -337,12 +337,12 @@ var points_cache=[];
prop_names.splice(n,1);
make_prop_select("prop_select", prop_names, prop_desc );
// Select measurement variable
// Apply default measurement variable/property if available
if ( "default_field" in conffile[parms.net].event_type[parms.event] ) {
$("#prop_select").val(conffile[parms.net].event_type[parms.event].default_field);
} else if (parms.property && (prop_names.indexOf(parms.property) > -1) ) {
if (parms.property && (prop_names.indexOf(parms.property) > -1) ) {
// Reapply already selected
$("#prop_select").val(parms.property);
} else if ( "default_field" in conffile[parms.net].event_type[parms.event] ) {
// Apply default measurement variable/property if available
$("#prop_select").val(conffile[parms.net].event_type[parms.event].default_field);
}
} else {
prop_names = prop_names_list[ event_sum_type[parms.event] ];
......@@ -353,13 +353,13 @@ var points_cache=[];
prop_names.splice(n,1);
make_prop_select("prop_select", prop_names, prop_desc );
// Select measurement variable
// Apply default measurement variable/property if available
if ( "default_summary_field" in conffile[parms.net].event_type[parms.event] ) {
$("#prop_select").val(conffile[parms.net].event_type[parms.event].default_summary_field);
} else if (parms.property && (prop_names.indexOf(parms.property) > -1) ) {
if (parms.property && (prop_names.indexOf(parms.property) > -1) ) {
// Reapply already selected
$("#prop_select").val(parms.property);
}
} else if ( "default_summary_field" in conffile[parms.net].event_type[parms.event] ) {
// Apply default measurement variable/property if available
$("#prop_select").val(conffile[parms.net].event_type[parms.event].default_summary_field);
}
}
parms.property = $("#prop_select").val();
......@@ -678,8 +678,20 @@ function only_links_by_color(color){
inverse=true;
search=node.substr(1,node.length);
}
var asn_search=false;
if (node.indexOf("@") >= 0){
// Search for AS numbers specified
asn_search=true;
search=node.substr(1,node.length);
}
for ( var ab in linkByName ){
if ( ab.indexOf(search) < 0 ){ // string not found
if (asn_search) {
if ( ! linkByName[ab].asn_search || linkByName[ab].asn_search.indexOf(search) < 0) {
// AS num not available or not found
linkByName[ab].remove();
}
} else if ( ab.indexOf(search) < 0 ){ // string not found
if ( ! inverse )
linkByName[ab].remove();
} else { // string found
......@@ -2012,7 +2024,15 @@ function get_connections(){
var msg = hhmmss(new Date()) + " Got " + nrecs + " " + etype + " records for " + $("#datepicker").val() + " " + $("#period_input").val() + " ;;";
$("#status").html( msg );
if (! jQuery.isEmptyObject(conffile) && conffile[parms.net].event_type[parms.event].asn_source ) {
// Extract and add relevant as-numbers to each connection
for (const h in last_hits) {
var ab = last_hits[h]._source.from + ',' + last_hits[h]._source.to;
if (linkByName[ab] && last_hits[h]._source.routechange_asn ) {
linkByName[ab].asn_search += last_hits[h]._source[conffile[parms.net].event_type[parms.event].asn_source] + " ";
}
}
}
// Refresh all links
if ( ! parms.connections)
taint_links(summary, $("#prop_select").val() );
......@@ -2281,6 +2301,7 @@ $(document).ready ( function(){
taint_links(summary, $("#prop_select").val() );
update_url();
parms.property = $("#prop_select").val();
$("#tabs").tabs("option", "active", 0);
});
......
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