Ignore:
Timestamp:
11/20/18 15:52:18 (4 years ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
5c46b9c
Parents:
7395b09
Message:

ipdist-parallel now reports cumulative count of lost packets to standard out, cleanup plotting script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/stats/ipdist-parallel.c

    rd83b5e72 ra7132cf  
    2626        /* Pointer to stats structure */
    2727        struct addr_stats *stats;
     28        uint64_t lost_packets;
    2829};
    2930struct addr_stats {
     
    400401                tally->stats->skewness_dst[i] = 0;
    401402        }
     403        tally->lost_packets = 0;
    402404        tally->lastkey = 0;
    403405        tally->packets = 0;
     
    426428
    427429        /* Finaly output the results */
    428         printf("Generating output \"%s/ipdist-%lu\"\n", stats_outputdir, tick);
     430        printf("Generating output \"%s/ipdist-%lu\" Packets lost: %lu\n", stats_outputdir, tick, tally->lost_packets);
    429431
    430432        /* Output the results */
     
    495497        }
    496498        tally->packets += results->packets;
     499
     500        /* Increment lost packets counter */
     501        struct libtrace_stat_t *statistics = trace_get_statistics(trace, NULL);
     502        if(statistics->dropped > tally->lost_packets) {
     503                /* update lost packets to the new number of dropped packets */
     504                tally->lost_packets = statistics->dropped;
     505        }
    497506
    498507        /* If the current timestamp is greater than the last printed plus the interval, output a result */
Note: See TracChangeset for help on using the changeset viewer.