Commit c857396c authored by Olav Kvittem's avatar Olav Kvittem
Browse files

1.19 improved jitter stats

parent 90d3b59f
......@@ -8,7 +8,7 @@ apt-get update
apt-get -y upgrade
package="mp-rude"
version="1.3.18"
version="1.3.19"
target="${package}_${version}_all"
......
......@@ -6,6 +6,7 @@
# use PDL::Fit::Polynomial;
use Socket;
use Statistics::LineFit;
use Statistics::Basic qw(:all);
use Date::Format;
use Getopt::Long;
use JSON::PP;
......@@ -299,7 +300,19 @@ sub emit_summary_json{
"reordered" => $reorder{$id} * 1 || 0,
"dTTL" => $dttl_count{$id} * 1 || 0,
"least_delay" => sprintf("%.3f", $least_delay{$id}*1000),
"down_ppm" => sprintf ( "%.3f", 10**6 * ($small_time{$id} + $big_time{$id}) / $duration{$id} ) * 1.0 # ppm
"down_ppm" => sprintf ( "%.3f", 10**6 * ($small_time{$id} + $big_time{$id}) / $duration{$id} ) * 1.0, # ppm
"h_jit" => median( $jitter_obs{$id}{"h_jit"} )->query, # ->query to put it in numerical context
"h_ddelay" => median( $jitter_obs{$id}{"h_ddelay"} )->query,
"h_min_d" => median( $jitter_obs{$id}{"h_min_d"} )->query,
"h_delay" => median( $jitter_obs{$id}{"h_delay"} )->query,
"h_slope_10" => median( $jitter_obs{$id}{"h_slope_10"} )->query,
"h_jit_sdv" => stddev( $jitter_obs{$id}{"h_jit"} )->query,
"h_ddelay_sdv" => stddev( $jitter_obs{$id}{"h_ddelay"} )->query,
"h_min_d_sdv" => stddev( $jitter_obs{$id}{"h_min_d"} )->query,
"h_delay_sdv" => stddev( $jitter_obs{$id}{"h_delay"} )->query,
"h_slope_10_sdv" => stddev( $jitter_obs{$id}{"h_slope_10"} )->query
};
foreach $gap_type( keys %$gap_limit ){ # note dropped gaps
$json{"dropped_$gap_type"}=$dropped_gaps{$id}{$gap_type};
......@@ -757,7 +770,7 @@ sub check_jitter{
};
emit_json($json, $id, $tstart);
$jitter_last{$id} = $tstart;
jitter_stats($jit);
jitter_stats($id, $json);
}
} else { # ignore
}
......@@ -765,7 +778,11 @@ sub check_jitter{
sub jitter_reg{
my ($id, $r, $var)=@_;
push( @{$jitter_obs{$id}{$var}}, $r{$var} );
if (defined($r->{$var})){
push( @{$jitter_obs{$id}{$var}}, $r->{$var} );
} else {
print "No data for $id $var, ";
}
}
sub jitter_stats{
my ($id, $r)=@_; #
......
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