[rabbitmq-discuss] What does the "SUMMARY_EVERY_US" mean in rabbitmq-c?
Brett Cameron
brett.r.cameron at gmail.com
Wed Jul 24 03:57:06 BST 2013
The definition of SUMMARY_EVERY_US implies that information (messages
received and the rate) will be printed every 100000 microseconds (US ==
microseconds).
Brett
On Wed, Jul 24, 2013 at 1:31 PM, Hugo <luhao.whu at gmail.com> wrote:
> 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.
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130724/4be560c5/attachment.htm>
More information about the rabbitmq-discuss
mailing list