diff options
author | emanuele-f <faranda@ntop.org> | 2020-02-14 11:42:20 +0100 |
---|---|---|
committer | emanuele-f <faranda@ntop.org> | 2020-02-14 11:42:20 +0100 |
commit | fd9427050700aea7a7e37ad7909c09aff721a797 (patch) | |
tree | cfdb121d3b37fcf5ed6098e213de657df0b4bb7a /example/ndpiReader.c | |
parent | 03cf975c077c0c709e48430f7f08425f4435d02e (diff) |
Remove decimals in test results for IAT, packet lengths and goodput ratio
Diffstat (limited to 'example/ndpiReader.c')
-rw-r--r-- | example/ndpiReader.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 09fd0e887..b91ddcccf 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1167,7 +1167,7 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa (flow->dst2src_packets > 0) ? "<->" : "->", flow->dst2src_packets, (long long unsigned int) flow->dst2src_bytes); - fprintf(out, "[Goodput ratio: %.1f/%.1f]", + fprintf(out, "[Goodput ratio: %.0f/%.0f]", 100.0*((float)flow->src2dst_goodput_bytes / (float)(flow->src2dst_bytes+1)), 100.0*((float)flow->dst2src_goodput_bytes / (float)(flow->dst2src_bytes+1))); @@ -1190,14 +1190,14 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa fprintf(out, "[bytes ratio: %.3f (%s)]", data_ratio, ndpi_data_ratio2str(data_ratio)); /* IAT (Inter Arrival Time) */ - fprintf(out, "[IAT c2s/s2c min/avg/max/stddev: %u/%u %.1f/%.1f %u/%u %.1f/%.1f]", + fprintf(out, "[IAT c2s/s2c min/avg/max/stddev: %u/%u %.0f/%.0f %u/%u %.0f/%.0f]", ndpi_data_min(flow->iat_c_to_s), ndpi_data_min(flow->iat_s_to_c), (float)ndpi_data_average(flow->iat_c_to_s), (float)ndpi_data_average(flow->iat_s_to_c), ndpi_data_max(flow->iat_c_to_s), ndpi_data_max(flow->iat_s_to_c), (float)ndpi_data_stddev(flow->iat_c_to_s), (float)ndpi_data_stddev(flow->iat_s_to_c)); /* Packet Length */ - fprintf(out, "[Pkt Len c2s/s2c min/avg/max/stddev: %u/%u %.1f/%.1f %u/%u %.1f/%.1f]", + fprintf(out, "[Pkt Len c2s/s2c min/avg/max/stddev: %u/%u %.0f/%.0f %u/%u %.0f/%.0f]", ndpi_data_min(flow->pktlen_c_to_s), ndpi_data_min(flow->pktlen_s_to_c), ndpi_data_average(flow->pktlen_c_to_s), ndpi_data_average(flow->pktlen_s_to_c), ndpi_data_max(flow->pktlen_c_to_s), ndpi_data_max(flow->pktlen_s_to_c), |