diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-09-03 10:10:18 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2003-09-03 10:10:18 +0000 |
commit | 25493878d94ab97a34eff9032f5d23fbe133854a (patch) | |
tree | ba251eda87a4062d5090a3d4bb3bf3296ccbada5 | |
parent | 672b08166cd0dbcda6db1e81657374c300b3511a (diff) |
fix to various stats tables.
The code used to rely on min_time==0 to determine whether this was the first
packet or not and whereby we had to initialize min_time to the current value.
This obviously does not work for capture files with poor timestamp resolution
where the response time is actually, according to the capture file, 0
and we got all sorts of weird effects like average response time being less than the minimum response time.
note, the bug only affected the minimum response time in the tables and not max or average response time.
it would "miss" tose minimum response times that were ==0 and display the minumin response time in the capture that were >0
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8358 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r-- | gtk/service_response_time_table.c | 9 | ||||
-rw-r--r-- | tap-dcerpcstat.c | 9 | ||||
-rw-r--r-- | tap-rpcstat.c | 9 | ||||
-rw-r--r-- | timestats.c | 8 |
4 files changed, 15 insertions, 20 deletions
diff --git a/gtk/service_response_time_table.c b/gtk/service_response_time_table.c index eb9400dc7d..d8cd4cf7fc 100644 --- a/gtk/service_response_time_table.c +++ b/gtk/service_response_time_table.c @@ -3,7 +3,7 @@ * Helper routines common to all service response time statistics * tap. * - * $Id: service_response_time_table.c,v 1.5 2003/06/22 04:00:21 gerald Exp $ + * $Id: service_response_time_table.c,v 1.6 2003/09/03 10:10:18 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -250,14 +250,12 @@ add_srt_table_data(srt_stat_table *rst, int index, nstime_t *req_time, packet_in delta.secs--; } - if((rp->max.secs==0) - && (rp->max.nsecs==0) ){ + if(rp->num==0){ rp->max.secs=delta.secs; rp->max.nsecs=delta.nsecs; } - if((rp->min.secs==0) - && (rp->min.nsecs==0) ){ + if(rp->num==0){ rp->min.secs=delta.secs; rp->min.nsecs=delta.nsecs; } @@ -282,6 +280,7 @@ add_srt_table_data(srt_stat_table *rst, int index, nstime_t *req_time, packet_in rp->tot.nsecs-=1000000000; rp->tot.secs++; } + rp->num++; } diff --git a/tap-dcerpcstat.c b/tap-dcerpcstat.c index df5e48c473..1ef20c3fb5 100644 --- a/tap-dcerpcstat.c +++ b/tap-dcerpcstat.c @@ -1,7 +1,7 @@ /* tap-dcerpcstat.c * dcerpcstat 2002 Ronnie Sahlberg * - * $Id: tap-dcerpcstat.c,v 1.5 2003/04/23 08:20:01 guy Exp $ + * $Id: tap-dcerpcstat.c,v 1.6 2003/09/03 10:10:17 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -110,14 +110,12 @@ dcerpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, void * delta.secs--; } - if((rp->max.secs==0) - && (rp->max.nsecs==0) ){ + if(rp->num==0){ rp->max.secs=delta.secs; rp->max.nsecs=delta.nsecs; } - if((rp->min.secs==0) - && (rp->min.nsecs==0) ){ + if(rp->num==0){ rp->min.secs=delta.secs; rp->min.nsecs=delta.nsecs; } @@ -142,6 +140,7 @@ dcerpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, void * rp->tot.nsecs-=1000000000; rp->tot.secs++; } + rp->num++; return 1; diff --git a/tap-rpcstat.c b/tap-rpcstat.c index 70f3b91f30..71f9cf53d5 100644 --- a/tap-rpcstat.c +++ b/tap-rpcstat.c @@ -1,7 +1,7 @@ /* tap-rpcstat.c * rpcstat 2002 Ronnie Sahlberg * - * $Id: tap-rpcstat.c,v 1.8 2003/04/23 08:20:02 guy Exp $ + * $Id: tap-rpcstat.c,v 1.9 2003/09/03 10:10:17 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -154,14 +154,12 @@ rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, void *pri delta.secs--; } - if((rp->max.secs==0) - && (rp->max.nsecs==0) ){ + if(rp->num==0){ rp->max.secs=delta.secs; rp->max.nsecs=delta.nsecs; } - if((rp->min.secs==0) - && (rp->min.nsecs==0) ){ + if(rp->num==0){ rp->min.secs=delta.secs; rp->min.nsecs=delta.nsecs; } @@ -186,6 +184,7 @@ rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, void *pri rp->tot.nsecs-=1000000000; rp->tot.secs++; } + rp->num++; return 1; diff --git a/timestats.c b/timestats.c index 0a09f3a38e..5593c26d89 100644 --- a/timestats.c +++ b/timestats.c @@ -2,7 +2,7 @@ * routines for time statistics * Copyrigth 2003 Lars Roland * - * $Id: timestats.c,v 1.1 2003/04/16 07:24:04 guy Exp $ + * $Id: timestats.c,v 1.2 2003/09/03 10:10:17 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -70,15 +70,13 @@ gdouble nstime_to_msec(nstime_t *time) void time_stat_update(timestat_t *stats, nstime_t *delta, packet_info *pinfo) { - if((stats->max.secs==0) - && (stats->max.nsecs==0) ){ + if(stats->num==0){ stats->max.secs=delta->secs; stats->max.nsecs=delta->nsecs; stats->max_num=pinfo->fd->num; } - if((stats->min.secs==0) - && (stats->min.nsecs==0) ){ + if(stats->num==0){ stats->min.secs=delta->secs; stats->min.nsecs=delta->nsecs; stats->min_num=pinfo->fd->num; |