From: wessels <> Date: Fri, 26 Jun 1998 10:23:33 +0000 (+0000) Subject: adjust sensitivity of peer RTT calculations. Changed the average factor X-Git-Tag: SQUID_3_0_PRE1~3135 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e39dc0e0c8ec19a16069a7e2f64c6bd4f8862692;p=thirdparty%2Fsquid.git adjust sensitivity of peer RTT calculations. Changed the average factor from 1000 to 50. Added a call to gettimeofday() in comm_incoming(). Surely someone will protest that. --- diff --git a/src/comm.cc b/src/comm.cc index 5219099709..53dcb4393b 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,7 +1,7 @@ /* - * $Id: comm.cc,v 1.271 1998/06/10 05:47:09 wessels Exp $ + * $Id: comm.cc,v 1.272 1998/06/26 04:23:33 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -770,6 +770,9 @@ comm_incoming(void) int j; incame = 0; io_events = 0; +#if !ALARM_UPDATES_TIME + getCurrentTime(); +#endif if (theInIcpConnection > 0) { icpHandleUdp(theInIcpConnection, &incame); if (theInIcpConnection != theOutIcpConnection) diff --git a/src/defines.h b/src/defines.h index 9267928bcd..82e3b09a0d 100644 --- a/src/defines.h +++ b/src/defines.h @@ -146,7 +146,7 @@ #define MAX_LOGIN_SZ 128 #define PEER_MAX_ADDRESSES 10 -#define RTT_AV_FACTOR 1000 +#define RTT_AV_FACTOR 50 /* flags for peer->mcast.flags */ #define PEER_COUNT_EVENT_PENDING 1 diff --git a/src/neighbors.cc b/src/neighbors.cc index 60ee124c42..2d1b560f72 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.222 1998/06/08 17:29:17 wessels Exp $ + * $Id: neighbors.cc,v 1.223 1998/06/26 04:23:34 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -671,7 +671,8 @@ neighborAlive(peer * p, const MemObject * mem, const icp_common_t * header) p->stats.counts[header->opcode]++; if (mem) { rtt = tvSubMsec(mem->start_ping, current_time); - p->stats.rtt = intAverage(p->stats.rtt, rtt, n, RTT_AV_FACTOR); + if (rtt) + p->stats.rtt = intAverage(p->stats.rtt, rtt, n, RTT_AV_FACTOR); p->icp_version = (int) header->version; } }