Navigation



Ignore:
Timestamp:
May 2, 2013, 1:59:58 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Use float type to solve /0 issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/dbg_monitor/dbg_monitor.c

    r1072 r1075  
    5656                        struct timespec * total, struct timespec * blocking, struct timespec * last)
    5757{
    58         long long throughput = (total_count * 1000000000) / ((total->tv_sec * 1000000000) + total->tv_nsec);
     58        long long ms = (total->tv_sec * 1000000) + (total->tv_nsec / 1000);
     59        long double throughput = (long double)total_count * 1000000;
     60        throughput /= ms;
    5961        if (peer) {
    60                 TRACE_DEBUG(INFO, "'%s'@'%s': cur:%d/%d, h:%d, T:%lld in %ld.%06lds (%llditems/s), blocked:%ld.%06lds, last processing:%ld.%06lds",
     62                TRACE_DEBUG(INFO, "'%s'@'%s': cur:%d/%d, h:%d, T:%lld in %ld.%06lds (%.2LFitems/s), blocked:%ld.%06lds, last processing:%ld.%06lds",
    6163                        queue_desc, peer, current_count, limit_count, highest_count,
    6264                        total_count, total->tv_sec, total->tv_nsec, throughput,
    6365                        blocking->tv_sec, blocking->tv_nsec, last->tv_sec, last->tv_nsec);
    6466        } else {
    65                 TRACE_DEBUG(INFO, "Global '%s': cur:%d/%d, h:%d, T:%lld in %ld.%06lds (%llditems/s), blocked:%ld.%06lds, last processing:%ld.%06lds",
     67                TRACE_DEBUG(INFO, "Global '%s': cur:%d/%d, h:%d, T:%lld in %ld.%06lds (%.2LFitems/s), blocked:%ld.%06lds, last processing:%ld.%06lds",
    6668                        queue_desc, current_count, limit_count, highest_count,
    6769                        total_count, total->tv_sec, total->tv_nsec, throughput,
Note: See TracChangeset for help on using the changeset viewer.