Commit 0e093c60 authored by Olav Kvittem's avatar Olav Kvittem
Browse files

routerr og routesum added. sum in popup of gap and routerr

parent cbb80201
Pipeline #49071 passed with stages
in 50 seconds
......@@ -83,72 +83,46 @@
<!--
<button class=knapp id="draw">Connections</button>
-->
<select id=network>
<select id=network title='Measurement network'>
<option value=dragonlab>Dragonlab</option>
<option value=uninett>Uninett</option>
</select>
<select id=event_type>
<select id=event_type title='Measurement type'>
<option value=gapsum>Gap summary</option>
<option value=gap>Gaps</option>
<option value=jitter>Queues</option>
<option value=routesum>Route summary</option>
<option value=routeerr>Route errors</option>
</select>
<select id=prop_select></select>
<select id=stats_type>
<option value=avg>Average</option>
<select id=prop_select title='Measurement variable'></select>
<select id=stats_type title='Statistics type'>
<option value="99.0">99%</option>
<option value="95.0">95%</option>
<option value="50.0">50%</option>
<option value="1.0">1%</option>
<!-- <option value=avg>Average</option>
<option value=min>Minimum</option>
<option value=max>Maximum</option>
</select>
<option value=max>Maximum</option> -->
</select>
<input class=knapp type="text" id="datepicker" size=12em>
<select id=period>
<select id=period title='Measurement period'>
<option value=1>Hour</option>
<option value=24 selected="selected">Day</option>
<option value=168>Week</option>
<option value=672>4 weeks</option>
<!--
<optgroup Label="Hour am">
<option value=0>0</option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
<option value=9>9</option>
<option value=10>10</option>
<option value=11>11</option>
</optgroup>
<optgroup Label="Hour pm">
<option value=12>12</option>
<option value=13>13</option>
<option value=14>14</option>
<option value=15>15</option>
<option value=16>16</option>
<option value=17>17</option>
<option value=18>18</option>
<option value=19>19</option>
<option value=20>20</option>
<option value=21>21</option>
<option value=22>22</option>
<option value=23>23</option>
</optgroup>
-->
</select>
<input class=knapp type="text" id="period_input" size=4em placeholder="hour">
<input class=knapp type="text" id="datepicker" size=12em title='Measurement start'>
<input class=knapp type="text" id="period_input" size=4em placeholder="00:00" title='Starting hour'>
<button class=knapp id=prev>Prev</button>
<button class=knapp id=next>Next</button>
<button class=knapp id=prev title='Previous period'>Prev</button>
<button class=knapp id=next title='Next period'>Next</button>
<!--
<button class=knapp id=search>Search</button>
-->
<input class=knapp type="search" id="search_input" size=5em placeholder=search>
<input class=knapp type="search" id="search_input" size=5em placeholder=search title='Type to select by link names'>
<!---->
<button class=knapp id=check>Check links</button>
<button class=knapp id=check title='See if links/flows are missing or asymmetric'>Check links</button>
<!---->
<span class=knapp id=refs></span>
<button class=knapp id=live title="Refresh display every minute">Autorefresh</button>
......@@ -211,20 +185,27 @@ var empty_color="LightGray";
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: "route_errors stopped_probes stopped_routes non_dest_probes total_analysed dest_reached max_length".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 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)",
tloss:"Time lost(ms)", h_slope_10:"Slope",
big_gaps:"Big gaps(#)", big_time:"Big gap time(s)", small_gaps:"Small gaps(#)", small_time:"Small gap time(s)",
total_analysed:"total_analysed", dest_reached:"dest_reached", max_length:"max_length",
route_errors:"route_errors", stopped_probes:"stopped_probes", stopped_routes:"stopped_routes",
non_dest_probes:"non_dest_probes",
anomaly_count:"anomaly_count", duration:"duration",
last_hop:"last_hop", last_reply_from:"last_reply_from", icmp_errors:"icmp_errors"
big_gaps:"Big gaps(#)", big_time:"Big gap time(s)", small_gaps:"Small gaps(#)", small_time:"Small gap time(s)"
};
var prop_sum = ['tloss', 'anomaly_count'];
// assign names as description temporarily
for ( const record of 'routesum routeerr'.split(" ") ){
for ( const prop of prop_names_list[record] ){
if ( ! prop_desc[prop] ) prop_desc[prop] = prop;
}
}
var stats_on={ jitter:true}; // show stats_type field
var stats_types = { "1.0": "1%", "50.0": "50%", "95.0": "95%", "99.0": "99%" };
var thresholds={
h_delay:[10,50],
h_min_d:[10,50],
......@@ -239,6 +220,13 @@ var loads=0; // number of loaded point series
var duplines=[];
var points_cache=[];
function fill_select(select_id, types){
var select = $("#".select_id);
select.empty();
for ( const type in types){
select.append( $('<option>', { value: type, text: types[type] } ) );
}
}
function show_map (network) {
console.log ("Showing map");
......@@ -313,6 +301,12 @@ function update_url(parameter, value){
url = urlBase+'?'+pars.join('&');
window.history.pushState('',document.title,url); // added this line to push the new url directly to url bar .
if ( stats_on[ $("#event_type").val() ] )
$("#stats_type").show();
else
$("#stats_type").hide();
}
function removeParam(parameter){
......@@ -605,7 +599,7 @@ function update_legend(title, threshes){
var dashboard={"uninett":'https://iou2.uninett.no/kibana/app/dashboards#/view/loss-uninett?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow%2Fd-1d%2Cto%3Anow%2Fd-1d))',
"dragonlab":'https://iou2.uninett.no/kibana/app/dashboards#/view/dragonlab-loss?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow%2Fd-1d%2Cto%3Anow%2Fd-1d))'};
var myboard = dashboard[ $("#network").val() ];
html += '<td><button class=knapp onclick=\'window.open("' + myboard + '", "_blank");\'>Dashboard</button>';
html += '<td><button class=knapp title="Kibana dashboard(limited access)" onclick=\'window.open("' + myboard + '", "_blank");\'>Dashboard</button>';
// html+='<td><button class=knapp onclick=\'window.open("https://iou2.uninett.no/kibana/goto/3e8ccd748e38c4814abbc531de059f13", "_blank");\'>Dashboard</button>';
html += "</tr></table>";
$("#legend").html(html);
......@@ -684,9 +678,12 @@ function make_tooltip(title, link){
if ( isNaN(link[prop]) ){
; // som text value
} else {
try {val = parseInt( link[prop] ).toFixed(1) ; }
let pname = prop;
// if ( prop_sum.indexOf(prop) >= 0 && link[prop + "_sum"] )
// pname=prop + "_sum";
try {val = parseFloat( link[pname] ).toFixed(1) ; }
catch(e) {
console.log('Invalid value of "' + title + '" prop:' + prop + ' val:' + link[prop] );
console.log('Invalid value of "' + title + '" prop:' + pname + ' val:' + link[pname] );
}
}
tip+= "<tr><td>" + desc + '<td align=right>' + val + "\n";
......@@ -793,7 +790,7 @@ function gap_list( from, to){
var gap = hit._source;
if ( ! etype) { // take first record as defining
etype = gap.event_type;
var amount_head = etype === "gap" ? "Queue" : "Cause";
var amount_head = etype === "gap" ? "Queue(ms)" : "Cause";
html="<table><thead><td>Day Time<td>Lost(s)<td>" + amount_head + "</thead>";
}
if ( gap.from === from && gap.to === to ){
......@@ -823,14 +820,14 @@ function gap_list( from, to){
var amount;
if ( etype === "gap"){
amount = gap.h_ddelay;
if ( typeof amount == "numeric") amount = amount.toFixed(1) ;
if ( typeof amount == "number") amount = amount.toFixed(1) ;
} else if ( etype === "routeerr" ){
//amount = typeof gap.icmp_errors === "undefined" ? "" : JSON.stringify( gap.icmp_errors );
amount = gap.cause + " " + gap.last_reply_from;
}
//html += "<tr><td>" + syslog_href + "<td>" + telemetry_href + "<td>" + gap.h_ddelay.toFixed(1) + "<td>" + "\n";
html += "<tr><td>" + tid + "<td>" + sec + "<td>" + amount + tail + "\n";
html += "<tr><td>" + tid + "<td align=right>" + sec + "<td align=right>" + amount + "<td>" + tail + "\n";
n++;
}
}
......@@ -891,14 +888,19 @@ function gap_list( from, to){
var rec={ from: stat[ab].from, to: stat[ab].to};
for ( const prop of prop_names_list[etype] ){
if ( stat[ab][prop].n > 0 ){
rec[prop]=stat[ab][prop].average();
rec[prop + "_max"]=stat[ab][prop].max();
if ( prop_sum.indexOf(prop) >= 0 )
rec[prop]=stat[ab][prop].sum;
else
rec[prop]=stat[ab][prop].average();
rec[prop + "_max"] = stat[ab][prop].max();
rec[prop + "_sum"] = stat[ab][prop].sum;
} else {
rec[prop] = msg[ab][prop].join();
}
}
if ( stat[ab].tloss )
if ( stat[ab].tloss ){
rec.down_ppm = ( stat[ab].tloss.sum * 1000000 / 1000 / period_length );
}
digest.push( {_source: rec} );
}
......@@ -925,11 +927,11 @@ function digest_aggregates(aggs, stats_type){
for (var j=0; j < to_buckets.length; j++){
var til=to_buckets[j].key;
if (parms.debug) console.log(fra + " - " + til + " = " + to_buckets[j].h_ddelay.avg );
var rec={ from: fra, to: til}
var rec={ from: fra, to: til};
for ( const prop in to_buckets[j] ){ // go through names
if ( typeof( to_buckets[j][prop] ) === 'object' ) { // stats record
rec[prop]= to_buckets[j][prop][stats_type];
rec[prop]= to_buckets[j][prop]['values'][stats_type];
//rec[prop + "_max"]=to_buckets[j][prop].max;
}
}
......@@ -1613,7 +1615,7 @@ function get_connections(){
}
var url="elastic-get-date-type.pl?index=" + index + "&event_type=" + etype
var url="elastic-get-date-type-4.pl?index=" + index + "&event_type=" + etype
+ "&start=" + start + "&end=" + end;
if (parms.debug) console.log(url);
......@@ -1624,11 +1626,9 @@ function get_connections(){
var nrecs=resp.hits.total.value.toString();
if ( etype === "gapsum" || etype === "routesum" ){
$("#stats_type").hide();
summary=resp.hits.hits;
} else if ( resp.aggregations){
aggregates=resp.aggregations;
$("#stats_type").show();
summary=digest_aggregates(aggregates, $("#stats_type").val());
nrecs = count_aggregates( aggregates );
} else { // gap records
......@@ -1713,6 +1713,7 @@ $(document).ready ( function(){
//$("#period").select2();
$("#period").change( function(){
get_connections();
$("#period_input").val('00:00');
});
$("#period_input").change( function(){
......@@ -1802,6 +1803,7 @@ $(document).ready ( function(){
});
// select parameter change
fill_select( "stats_type", stats_types );
$("#stats_type").change( function(){
summary=digest_aggregates(aggregates, $("#stats_type").val());
taint_links(summary, $("#prop_select").val() );
......
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