mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-19 12:42:32 +02:00
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.
This commit is contained in:
@@ -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 [])
|
|||||||
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;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user