Commit 84ab7718 authored by Jake Cobb's avatar Jake Cobb

Problem: Throughput calculation underestimates slow messages

Solution: Use a double for messages per second and calculate
Megabits per second using it.  Truncate messages per second
only in the reported output.
parent 78b26d7a
...@@ -49,7 +49,7 @@ int main (int argc, char *argv []) ...@@ -49,7 +49,7 @@ int main (int argc, char *argv [])
zmq_msg_t msg; zmq_msg_t msg;
void *watch; void *watch;
unsigned long elapsed; unsigned long elapsed;
unsigned long throughput; double throughput;
double megabits; double megabits;
int curve = 0; int curve = 0;
...@@ -138,7 +138,7 @@ int main (int argc, char *argv []) ...@@ -138,7 +138,7 @@ int main (int argc, char *argv [])
return -1; return -1;
} }
throughput = (unsigned long) throughput =
((double) message_count / (double) elapsed * 1000000); ((double) message_count / (double) elapsed * 1000000);
megabits = ((double) throughput * message_size * 8) / 1000000; megabits = ((double) throughput * message_size * 8) / 1000000;
......
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