Changeset a7132cf


Ignore:
Timestamp:
11/20/18 15:52:18 (2 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

Location:
examples/stats
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • examples/stats/ipdist-genplot.py

    r7395b09 ra7132cf  
    200200        plot.stdin.write("set ylabel 'Cumulative %'\n")
    201201        plot.stdin.write("set xrange[0:255]\n")
     202        plot.stdin.write("set xtics 0,10,255\n")
    202203        plot.stdin.write("set key off\n")
    203204        for x in range(len(dataFiles)):
     
    217218        plot.stdin.write("set ylabel 'Cumulative %'\n")
    218219        plot.stdin.write("set xrange[0:255]\n")
     220        plot.stdin.write("set xtics 0,10,255\n")
    219221        plot.stdin.write("set key off\n")
    220222        for x in range(len(dataFiles)):
     
    230232        plot.stdin.write("\n")
    231233
    232         plot.stdin.write("set title 'Timeseries mean skewness'\n")
     234        plot.stdin.write("set title 'Skew octet " + str(i+1) + "'\n")
    233235        plot.stdin.write("set yrange[-1:1]\n")
    234         plot.stdin.write("set xlabel 'Timestamp'\n")
     236        plot.stdin.write("set xlabel 'Time'\n")
    235237        plot.stdin.write("set ylabel 'Skewness'\n")
    236238        plot.stdin.write("set autoscale x\n")
  • 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.