[rabbitmq-discuss] What does the "SUMMARY_EVERY_US" mean in rabbitmq-c?
Hugo
luhao.whu at gmail.com
Wed Jul 24 02:31:36 BST 2013
Hey, there
I am using rabbitmq-c for some applications. I got those code from the
amqp_consumer.c, and the filed "next_summary_time " seemed to confuse me.
What does the if
clause (in bold) do here?
Many thanks!
> ......
#define SUMMARY_EVERY_US 100000
......
uint64_t next_summary_time = start_time + SUMMARY_EVERY_US;
> uint64_t now = now_microseconds();
> * **if (now > next_summary_time) {*
> int countOverInterval = received - previous_received;
> double intervalRate = countOverInterval / ((now -
> previous_report_time) / 1000000.0);
> printf("%d ms: Received %d - %d since last report (%d Hz)\n",
> (int)(now - start_time) / 1000, received, countOverInterval,
> (int) intervalRate);
>
> previous_received = received;
> previous_report_time = now;
> next_summary_time += SUMMARY_EVERY_US;
> }
>
> amqp_maybe_release_buffers(conn);
> ......
Hugo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130723/ea610435/attachment.htm>
More information about the rabbitmq-discuss
mailing list