Minor editorial changes to comments from PR #1174.

No functional changes.
This commit is contained in:
Bruce A. Mah 2021-07-16 14:30:43 -07:00
parent 0d078c4a1d
commit 1b577aea91
No known key found for this signature in database
GPG Key ID: 4984910A8CAAEE8A

View File

@ -3729,12 +3729,19 @@ iperf_print_results(struct iperf_test *test)
lost_percent = 0.0;
}
if (test->json_output) {
/*
* Original, summary structure. Using this
* structure is not recommended due to
* ambiguities between the sender and receiver.
*/
cJSON_AddItemToObject(test->json_end, "sum", iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f jitter_ms: %f lost_packets: %d packets: %d lost_percent: %f sender: %b", (double) start_time, (double) receiver_time, (double) receiver_time, (int64_t) total_sent, bandwidth * 8, (double) avg_jitter * 1000.0, (int64_t) lost_packets, (int64_t) total_packets, (double) lost_percent, stream_must_be_sender));
/* Modifications to add sum_sent and sum_received to UDP JSON results - DJ */
/* For historical reasons (and hysterical raisins), "sum" section NOT REMOVED */
/*
* Separate sum_sent and sum_received structures.
* Using these structures to get the most complete
* information about UDP transfer.
*/
cJSON_AddItemToObject(test->json_end, "sum_sent", iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f jitter_ms: %f lost_packets: %d packets: %d lost_percent: %f sender: %b", (double) start_time, (double) sender_time, (double) sender_time, (int64_t) total_sent, (double) total_sent * 8 / sender_time, (double) 0.0, (int64_t) 0, (int64_t) sender_total_packets, (double) 0.0, 1));
cJSON_AddItemToObject(test->json_end, "sum_received", iperf_json_printf("start: %f end: %f seconds: %f bytes: %d bits_per_second: %f jitter_ms: %f lost_packets: %d packets: %d lost_percent: %f sender: %b", (double) start_time, (double) receiver_time, (double) receiver_time, (int64_t) total_received, (double) total_received * 8 / receiver_time, (double) avg_jitter * 1000.0, (int64_t) lost_packets, (int64_t) receiver_total_packets, (double) lost_percent, 0));
/* End Modifications to add sum_sent and sum_received to UDP JSON results - DJ */
} else {
/*
* On the client we have both sender and receiver overall summary