Collect packet/bytes statistics for the capture in intervals of
I<interval> seconds. I<Intervals> can be specified either as whole or
fractional seconds. Interval can be specified in ms resolution.
+If Interval is 0, the statistics will be calculated over all packets.
If no I<filter> is specified the statistics will be calculated for all packets.
If one or more I<filters> are specified statistics will be calculated for
printf("\n");
printf("===================================================================\n");
printf("IO Statistics\n");
- printf("Interval: %d.%03d secs\n", iot->interval/1000, iot->interval%1000);
+ if(iot->interval!=G_MAXINT32)
+ printf("Interval: %d.%03d secs\n", iot->interval/1000, iot->interval%1000);
for(i=0;i<iot->num_items;i++){
printf("Column #%d: %s\n",i,iot->filters[i]?iot->filters[i]:"");
}
}
if(more_items){
- printf("%03d.%03d-%03d.%03d ",
- t/1000,t%1000,
- (t+iot->interval)/1000,(t+iot->interval)%1000);
+ if(iot->interval==G_MAXINT32) {
+ printf("000.000- ");
+ } else {
+ printf("%03d.%03d-%03d.%03d ",
+ t/1000,t%1000,
+ (t+iot->interval)/1000,
+ (t+iot->interval)%1000);
+ }
for(i=0;i<iot->num_items;i++){
switch(iot->items[i].calc_type){
case CALC_TYPE_BYTES:
exit(1);
}
+ /* if interval is 0, calculate statistics over the whole file
+ * by setting the interval to G_MAXINT32
+ */
+ if(interval_float==0) {
+ interval=G_MAXINT32;
+ } else {
+ /* make interval be number of ms */
+ interval=(gint32)(interval_float*1000.0+0.9);
+ }
- /* make interval be number of ms */
- interval=(gint32)(interval_float*1000.0+0.9);
if(interval<1){
- fprintf(stderr, "tshark: \"-z\" interval must be >=0.001 seconds.\n");
+ fprintf(stderr, "tshark: \"-z\" interval must be >=0.001 seconds or 0.\n");
exit(10);
}