Skip to content

Commit d36dafb

Browse files
author
steve-roscio
committed
Put standard deviation into its own line for easier parsing
1 parent a3651d4 commit d36dafb

3 files changed

Lines changed: 34 additions & 27 deletions

File tree

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,15 @@ Options:
4444

4545
```
4646
# bin/sshping -d cheyenne.example.com
47-
ssh-Login-Time: 1,730,431,639 nsec
48-
Minimum-Latency: 836,491 nsec
49-
Median-Latency: 1,006,323 nsec +/- 165,214 std dev
50-
Average-Latency: 1,026,238 nsec
51-
Maximum-Latency: 4,090,103 nsec
52-
Echo-Count: 1,000 Bytes
53-
Transfer-Size: 8,000,000 Bytes
54-
Upload-Rate: 5,044,247 Bytes/second
47+
ssh-Login-Time: 1,733,748,227 nsec
48+
Minimum-Latency: 847,107 nsec
49+
Median-Latency: 996,029 nsec
50+
Average-Latency: 992,186 nsec
51+
Average-Deviation: 67,079 nsec
52+
Maximum-Latency: 1,289,470 nsec
53+
Echo-Count: 1,000 Bytes
54+
Transfer-Size: 8,000,000 Bytes
55+
Upload-Rate: 5,102,315 Bytes/second
5556
```
5657

5758
## Building

doc/sshping.pod

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,17 @@ Median-Latency
109109
not the same as the average; think of this as the "typical"
110110
latency. You probably want this number when you think average.
111111

112-
The standard deviation is also shown. Yes, it can be greater
113-
than the median!
114-
115112
Average-Latency
116113
The average (mean) round-trip time for a character echo,
117114
in nanoseconds.
118115

116+
Average-Deviation
117+
The standard deviation on the average latency. It quantifies
118+
how varied the latency is for each character's echo. A lower
119+
number indicates a tighter grouping of latencies, a
120+
higher number indicates more variation in the latencies.
121+
"One" standard deviation is the average plus or minus this amount.
122+
119123
Maximum-Latency
120124
The slowest (highest) round-trip time for a character echo,
121125
in nanoseconds.
@@ -144,14 +148,15 @@ Upload-Rate
144148
=head1 EXAMPLES
145149

146150
# bin/sshping -d cheyenne.example.com
147-
ssh-Login-Time: 1,730,431,639 nsec
148-
Minimum-Latency: 836,491 nsec
149-
Median-Latency: 1,006,323 nsec +/- 165,214 std dev
150-
Average-Latency: 1,026,238 nsec
151-
Maximum-Latency: 4,090,103 nsec
152-
Echo-Count: 1,000 Bytes
153-
Transfer-Size: 8,000,000 Bytes
154-
Upload-Rate: 5,044,247 Bytes/second
151+
ssh-Login-Time: 1,733,748,227 nsec
152+
Minimum-Latency: 847,107 nsec
153+
Median-Latency: 996,029 nsec
154+
Average-Latency: 992,186 nsec
155+
Average-Deviation: 67,079 nsec
156+
Maximum-Latency: 1,289,470 nsec
157+
Echo-Count: 1,000 Bytes
158+
Transfer-Size: 8,000,000 Bytes
159+
Upload-Rate: 5,102,315 Bytes/second
155160

156161

157162
=head1 AUTHOR

src/sshping.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ ssh_channel login_channel(ssh_session & ses) {
403403
if (verbosity) {
404404
printf("+++ Login shell established\n");
405405
}
406-
printf("ssh-Login-Time: %15s nsec\n", fmtnum(nsec_diff(t0, t1)).c_str());
406+
printf("ssh-Login-Time: %16s nsec\n", fmtnum(nsec_diff(t0, t1)).c_str());
407407

408408
return chn;
409409
}
@@ -481,11 +481,12 @@ int run_echo_test(ssh_channel & chn) {
481481
med_latency = (latencies[num_sent / 2 - 1] + latencies[(num_sent + 1) / 2 - 1]) / 2;
482482
}
483483
uint64_t stddev = standard_deviation(latencies, avg_latency);
484-
printf("Minimum-Latency: %13s nsec\n", fmtnum(min_latency).c_str());
485-
printf("Median-Latency: %13s nsec +/- %s std dev\n", fmtnum(med_latency).c_str(), fmtnum(stddev).c_str());
486-
printf("Average-Latency: %13s nsec\n", fmtnum(avg_latency).c_str());
487-
printf("Maximum-Latency: %13s nsec\n", fmtnum(max_latency).c_str());
488-
printf("Echo-Count: %13s Bytes\n", fmtnum(num_sent).c_str());
484+
printf("Minimum-Latency: %13s nsec\n", fmtnum(min_latency).c_str());
485+
printf("Median-Latency: %13s nsec\n", fmtnum(med_latency).c_str());
486+
printf("Average-Latency: %13s nsec\n", fmtnum(avg_latency).c_str());
487+
printf("Average-Deviation: %13s nsec\n", fmtnum(stddev).c_str());
488+
printf("Maximum-Latency: %13s nsec\n", fmtnum(max_latency).c_str());
489+
printf("Echo-Count: %13s Bytes\n", fmtnum(num_sent).c_str());
489490

490491
// Terminate the echo responder
491492
// TODO
@@ -502,7 +503,7 @@ int run_speed_test(ssh_session ses) {
502503
if (verbosity) {
503504
printf("+++ Speed test started\n");
504505
}
505-
printf("Transfer-Size: %13s Bytes\n", fmtnum(size * MEGA).c_str());
506+
printf("Transfer-Size: %13s Bytes\n", fmtnum(size * MEGA).c_str());
506507

507508
ssh_scp scp = ssh_scp_new(ses, SSH_SCP_WRITE, tgt);
508509
if (scp == NULL) {
@@ -544,7 +545,7 @@ int run_speed_test(ssh_session ses) {
544545
if (duration == 0.0) duration = 0.000001;
545546
uint64_t Bps = double(size * MEGA) / duration;
546547

547-
printf("Upload-Rate: %13s Bytes/second\n", fmtnum(Bps).c_str());
548+
printf("Upload-Rate: %13s Bytes/second\n", fmtnum(Bps).c_str());
548549
if (verbosity) {
549550
printf("+++ Speed test completed\n");
550551
}

0 commit comments

Comments
 (0)