@@ -483,10 +483,15 @@ function requestEchoByTime(form_data) {
483
483
var time = d . graph [ i ] . Inserted - d . graph [ i ] . ActualDuration ;
484
484
updatePingGraph ( chartSE , data , time )
485
485
486
- // update latency stats, when valid
486
+ // update latency stats, when valid, use average
487
487
if ( d . graph [ i ] . ResponseTime > 0 ) {
488
- setEchoLatency ( d . graph [ i ] . Path . match ( "\\[.*]" ) ,
489
- d . graph [ i ] . ResponseTime ) ;
488
+ var path = setEchoLatency ( d . graph [ i ] . Path
489
+ . match ( "\\[.*]" ) , d . graph [ i ] . ResponseTime ) ;
490
+ if ( path . latency ) {
491
+ var latStr = parseFloat ( path . latency . Avg )
492
+ . toFixed ( 1 ) ;
493
+ $ ( '#path-lat-' + path . listIdx ) . html ( latStr ) ;
494
+ }
490
495
}
491
496
}
492
497
}
@@ -507,7 +512,11 @@ function requestTraceRouteByTime(form_data) {
507
512
} else {
508
513
enableTestControls ( true ) ;
509
514
releaseTabs ( ) ;
510
- clearInterval ( intervalGraphData ) ;
515
+ if ( d . graph != null ) {
516
+ clearInterval ( intervalGraphData ) ;
517
+ } else {
518
+ lastTimeBwDb = form_data . since ;
519
+ }
511
520
}
512
521
}
513
522
if ( d . graph != null ) {
@@ -518,29 +527,35 @@ function requestTraceRouteByTime(form_data) {
518
527
// result returned, display it and reset progress
519
528
handleEndCmdDisplay ( d . graph [ i ] . CmdOutput ) ;
520
529
}
521
- // var data = {
522
- // 'responseTime' : d.graph[i].ResponseTime,
523
- // 'runTime' : d.graph[i].RunTime,
524
- // 'loss' : d.graph[i].PktLoss,
525
- // 'path' : d.graph[i].Path,
526
- // 'error' : d.graph[i].Error,
527
- // };
528
- // if (data.runTime == 0) {
529
- // // for other errors, use execution time
530
- // data.runTime = d.graph[i].ActualDuration;
531
- // }
532
- // console.info(JSON.stringify(data));
530
+
533
531
console . info ( 'continuous traceroute' , 'duration:' ,
534
532
d . graph [ i ] . ActualDuration , 'ms' ) ;
535
533
// use the time the test began
536
534
var time = d . graph [ i ] . Inserted - d . graph [ i ] . ActualDuration ;
537
- // updatePingGraph(chartSE, data, time)
538
535
539
536
// TODO (mwfarb): implement traceroute graph
540
537
541
- // update latency stats
542
- setTracerouteLatency ( d . graph [ i ] . Path . match ( "\\[.*]" ) ,
543
- d . graph [ i ] . TrHops ) ;
538
+ // update latency stats, when valid, use average
539
+ var path = setTracerouteLatency ( d . graph [ i ] . Path
540
+ . match ( "\\[.*]" ) , d . graph [ i ] . TrHops ) ;
541
+ for ( var i = 0 ; i < path . interfaces . length ; i ++ ) {
542
+ var if_ = path . interfaces [ i ] ;
543
+ if ( i < path . interfaces . length - 1 ) {
544
+ if ( path . interfaces [ i ] . latency ) {
545
+ var latStr = parseFloat (
546
+ path . interfaces [ i ] . latency . Avg )
547
+ . toFixed ( 1 ) ;
548
+ $ ( '#path-lat-' + path . listIdx + '-' + i ) . html (
549
+ latStr ) ;
550
+ }
551
+ } else {
552
+ if ( path . latency ) {
553
+ var latStr = parseFloat ( path . latency . Avg )
554
+ . toFixed ( 1 ) ;
555
+ $ ( '#path-lat-' + path . listIdx ) . html ( latStr ) ;
556
+ }
557
+ }
558
+ }
544
559
}
545
560
}
546
561
}
@@ -683,6 +698,11 @@ function command(continuous) {
683
698
name : "pathStr" ,
684
699
value : formatPathString ( resPath , self . segNum , self . segType )
685
700
} ) ;
701
+ } else if ( continuous ) { // all paths in survey
702
+ form_data . push ( {
703
+ name : "pathStr" ,
704
+ value : formatPathStringAll ( resPath , 'PATH' )
705
+ } ) ;
686
706
}
687
707
}
688
708
if ( activeApp == "bwtester" ) {
@@ -827,7 +847,7 @@ function handleContResponse(resp, continuous, startTime) {
827
847
clearInterval ( intervalGraphData ) ;
828
848
}
829
849
if ( ! continuous ) {
830
- manageTestData ( ) ;
850
+ manageTestData ( startTime ) ;
831
851
}
832
852
}
833
853
0 commit comments