Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG generation for graph details #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/copy-to-website.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

rsync --delete -avP *.png *.html ~/my.www.dir/html/graphs/
rsync --delete -avP *.png *.svg *.html ~/my.www.dir/html/graphs/
3 changes: 2 additions & 1 deletion bin/diff-freq-graph
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
TERMINAL=$1

LINSCALELIMIT=1
for stat in statistics.*; do
Expand All @@ -10,7 +11,7 @@ LINSCALELIMIT=`echo $LINSCALELIMIT | ../bin/mul 1000000`
# echo $LINSCALELIMIT

(
../bin/graph-header all-diff-freq.png $LINSCALELIMIT "%1.1f us/s" "all clocks (diff freq)" "set yrange [-3:3]"
../bin/graph-header all-diff-freq $TERMINAL $LINSCALELIMIT "%1.1f us/s" "all clocks (diff freq)" "set yrange [-3:3]"
../bin/foreach-stat "'__FILE__' using 1:(\$6*1000000) title '__TITLE__' with line \\"
echo
) | gnuplot
15 changes: 8 additions & 7 deletions bin/graph-header
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#!/bin/bash

FILENAME=$1
LINSCALELIMIT=$2
FORMAT=$3
TITLE=$4
CUSTOM=$5
BASENAME=$1
TERMINAL=$2
LINSCALELIMIT=$3
FORMAT=$4
TITLE=$5
CUSTOM=$6

YTICS=`../bin/linlogytics $LINSCALELIMIT`

#echo $LINSCALELIMIT 1>&2
#echo $YTICS 1>&2

cat <<EOF
set terminal png size 900,600
set terminal $TERMINAL size 900,600
set xdata time
set timefmt "%s"
set output "$FILENAME"
set output "$BASENAME.$TERMINAL"
set grid
set xlabel "Time"
set format x "%d-%H:%M"
Expand Down
6 changes: 5 additions & 1 deletion bin/index
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@ my $ALL_REMOTES = "";
my $ALL_REMOTES_WITH_LINK = "";
foreach my $r (@remotes) {
my $remote = $r;
my $link = $r;
if ($ENV["GNUPLOT_TERMINALS"] == "png svg") {
$link =~ s/png$/svg/;
}
$remote =~ s/^remote-statistics\.//;
$remote =~ s/\.(svg|png)$//;
my $key = $remote;
$key =~ s/_/:/g;
my $desc = $titles{"statistics.$key"} || $key;
my $img = "<img src=\"$r\" alt=\"Remote clock: $desc\" />";
$ALL_REMOTES .= "$img<br />\n";
$ALL_REMOTES_WITH_LINK .= "<a href=\"$remote\">$img</a><br />\n";
$ALL_REMOTES_WITH_LINK .= "<a href=\"$link\">$img</a><br />\n";
}

open(TMPL,"<","index.html.tmpl");
Expand Down
13 changes: 7 additions & 6 deletions bin/local-clock-graph
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
TERMINAL=$1

LINSCALELIMIT=`../bin/linscalelimit 1 5 tracking.log | ../bin/mul 1000000`

Expand All @@ -7,10 +8,10 @@ LINSCALELIMIT=`../bin/linscalelimit 1 5 tracking.log | ../bin/mul 1000000`
YTICS=`../bin/linlogytics $LINSCALELIMIT`

gnuplot <<EOF
set terminal png size 900,600
set terminal $TERMINAL size 900,600
set xdata time
set timefmt "%s"
set output "local-clock.png"
set output "local-clock.$TERMINAL"
set grid
set xlabel "Time"
set format x "%d-%H:%M"
Expand Down Expand Up @@ -38,10 +39,10 @@ ONE=`../bin/percentile 8 1 tracking.log | ../bin/mul 1000000`
NF_M_F=`echo $NINETYFIVE - $FIVE | bc`
NN_M_O=`echo $NINETYNINE - $ONE | bc`
gnuplot <<EOF
set terminal png size 900,600
set terminal $TERMINAL size 900,600
set xdata time
set timefmt "%s"
set output "local-clock-stddev.png"
set output "local-clock-stddev.$TERMINAL"
set grid
set xlabel "Time"
set format x "%d-%H:%M"
Expand Down Expand Up @@ -73,10 +74,10 @@ ONE=`../bin/percentile 4 1 tracking.log`
NF_M_F=`echo $NINETYFIVE - $FIVE | bc`
NN_M_O=`echo $NINETYNINE - $ONE | bc`
gnuplot <<EOF
set terminal png size 900,600
set terminal $TERMINAL size 900,600
set xdata time
set timefmt "%s"
set output "local-clock-skew.png"
set output "local-clock-skew.$TERMINAL"
set grid
set xlabel "Time"
set format x "%d-%H:%M"
Expand Down
13 changes: 7 additions & 6 deletions bin/offset-graph
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
TERMINAL=$1

LINSCALELIMIT=1
for stat in statistics.*; do
Expand All @@ -8,7 +9,7 @@ done
LINSCALELIMIT=`echo $LINSCALELIMIT | ../bin/mul 1000000`

(
../bin/graph-header all-offset.png $LINSCALELIMIT "%1.0f us" "all clocks (offset)" ""
../bin/graph-header all-offset $TERMINAL $LINSCALELIMIT "%1.0f us" "all clocks (offset)" ""
../bin/foreach-stat "'__FILE__' using 1:(\$4*1000000) title '__TITLE__' with line \\"
echo
) | gnuplot
Expand All @@ -24,7 +25,7 @@ else
fi

#(
# ../bin/graph-header remote-strat1.png 1 "%1.0f us" "offset of remote strat1s" ""
# ../bin/graph-header remote-strat1 $TERMINAL "%1.0f µs" "Offset Of Remote Stratum-1s" ""
# i=0
# echo "$titles" | while read file title; do
# if [ $i != 0 ]; then
Expand All @@ -37,7 +38,7 @@ fi
#) | gnuplot
#
#(
# ../bin/graph-header remote-strat1-downstream.png 1 "%1.0f us" "offset-rtt/2 of remote strat1s" ""
# ../bin/graph-header remote-strat1-downstream $TERMINAL "%1.0f µs" "Offset-RTT/2 Of Remote Stratum-1s" ""
# i=0
# echo "$titles" | while read file title; do
# measurements_file=`echo $file | sed 's/^statistics/measurements/'`
Expand All @@ -57,13 +58,13 @@ echo "$titles" | while read file title; do
imagename=`echo $file | sed 's/:/_/g'`
measurements_file=`echo $file | sed 's/^statistics/measurements/'`
# Run only (1) for existing files and (2) once, so `titles.*` can be a sub-/superset
if [ -f "$file" -a ! -f "remote-${imagename}.png" -a ! -f "remote-${imagename}.svg" ]; then
if [ -f "$file" -a ! -f "remote-${imagename}.$TERMINAL" ]; then
(
if [ -f $measurements_file ]; then
FIFTY=`../bin/percentile 10 50 $measurements_file | ../bin/mul 1000000`
CUSTOM="set label 1 gprintf('50%% = $FIFTY us',50) at graph 0.01,0.05 left front"
LINSCALELIMIT=`../bin/linscalelimit 1 10 $measurements_file | ../bin/mul 1000000`
../bin/graph-header remote-${imagename}.png $LINSCALELIMIT "%1.0f us" "offset of $title" "$CUSTOM"
../bin/graph-header remote-${imagename} $TERMINAL $LINSCALELIMIT "%1.0f us" "offset of $title" "$CUSTOM"
echo "'$measurements_file' using 1:(\$11*1000000) title 'offset' with line, \\"
echo "'$measurements_file' using 1:((\$11+\$12/2)*1000000) title 'offset+rtt/2' with line, \\"
echo "'$measurements_file' using 1:((\$11-\$12/2)*1000000) title 'offset-rtt/2' with line, \\"
Expand All @@ -72,7 +73,7 @@ echo "$titles" | while read file title; do
FIFTY=`../bin/percentile 3 50 $file | ../bin/mul 1000000`
CUSTOM="set label 1 gprintf('50%% = $FIFTY us',50) at graph 0.01,0.05 left front"
LINSCALELIMIT=`../bin/linscalelimit 1 3 $file | ../bin/mul 1000000`
../bin/graph-header remote-${imagename}.png $LINSCALELIMIT "%1.0f us" "offset of $title" "$CUSTOM"
../bin/graph-header remote-${imagename} $TERMINAL $LINSCALELIMIT "%1.0f us" "offset of $title" "$CUSTOM"
echo "'$file' using 1:(\$4*1000000) title 'offset' with line, \\"
echo "$FIFTY title '50th percentile'"
fi
Expand Down
Loading