/*
- * $Id: comm_select.cc,v 1.5 1998/08/14 09:22:33 wessels Exp $
+ * $Id: comm_select.cc,v 1.6 1998/09/03 03:37:33 wessels Exp $
*
* DEBUG: section 5 Socket Functions
*
int callicp = 0, callhttp = 0;
static time_t last_timeout = 0;
double timeout = current_dtime + (msec / 1000.0);
+ double start;
do {
#if !ALARM_UPDATES_TIME
getCurrentTime();
+ start = current_dtime;
#endif
#if USE_ASYNC_IO
aioCheckCallbacks();
if ((hdl = fd_table[fd].read_handler)) {
fd_table[fd].read_handler = NULL;
hdl(fd, fd_table[fd].read_data);
+ Counter.select_fds++;
}
if (commCheckICPIncoming)
comm_poll_icp_incoming();
if ((hdl = fd_table[fd].write_handler)) {
fd_table[fd].write_handler = NULL;
hdl(fd, fd_table[fd].write_data);
+ Counter.select_fds++;
}
if (commCheckICPIncoming)
comm_poll_icp_incoming();
comm_poll_icp_incoming();
if (callhttp)
comm_poll_http_incoming();
+#if !ALARM_UPDATES_TIME
+ getCurrentTime();
+ Counter.select_time += (current_dtime - start);
+#endif
return COMM_OK;
} while (timeout > current_dtime);
debug(5, 8) ("comm_poll: time out: %d.\n", squid_curtime);
hdl = fd_table[fd].read_handler;
fd_table[fd].read_handler = NULL;
hdl(fd, fd_table[fd].read_data);
+ Counter.select_fds++;
}
if (commCheckICPIncoming)
comm_select_icp_incoming();
hdl = fd_table[fd].write_handler;
fd_table[fd].write_handler = NULL;
hdl(fd, fd_table[fd].write_data);
+ Counter.select_fds++;
}
if (commCheckICPIncoming)
comm_select_icp_incoming();
/*
- * $Id: protos.h,v 1.258 1998/08/27 06:28:58 wessels Exp $
+ * $Id: protos.h,v 1.259 1998/09/03 03:37:34 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern EVH netdbExchangeStart;
extern void netdbExchangeUpdatePeer(struct in_addr, peer *, double, double);
extern peer *netdbClosestParent(request_t *);
-void netdbHostData(const char *host, int *samp, int *rtt, int *hops);
+extern void netdbHostData(const char *host, int *samp, int *rtt, int *hops);
extern void cachemgrStart(int fd, request_t * request, StoreEntry * entry);
extern void cachemgrRegister(const char *, const char *, OBJH *, int, int);
extern void pconnHistCount(int, int);
extern int stat5minClientRequests(void);
extern double stat5minCPUUsage(void);
-
+extern double statMedianSvc(int, int);
/* StatHist */
/*
- * $Id: stat.cc,v 1.281 1998/08/21 16:58:12 wessels Exp $
+ * $Id: stat.cc,v 1.282 1998/09/03 03:37:35 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
static void statCountersInitSpecial(StatCounters *);
static void statCountersClean(StatCounters *);
static void statCountersCopy(StatCounters * dest, const StatCounters * orig);
-static double statMedianSvc(int, int);
static void statStoreEntry(StoreEntry * s, StoreEntry * e);
static double statCPUUsage(int minutes);
static OBJH stat_io_get;
XAVG(page_faults));
storeAppendPrintf(sentry, "select_loops = %f/sec\n",
XAVG(select_loops));
+ storeAppendPrintf(sentry, "select_fds = %f/sec\n",
+ XAVG(select_fds));
+ storeAppendPrintf(sentry, "average_select_fd_period = %f/fd\n",
+ f->select_fds > l->select_fds ?
+ (f->select_time - l->select_time) / (f->select_fds - l->select_fds)
+ : 0.0);
storeAppendPrintf(sentry, "cpu_time = %f seconds\n", ct);
storeAppendPrintf(sentry, "wall_time = %f seconds\n", dt);
storeAppendPrintf(sentry, "cpu_usage = %f%%\n", dpercent(ct, dt));
statAvgDump(e, 60, 0);
}
-static double
+double
statMedianSvc(int interval, int which)
{
StatCounters *f;
/*
- * $Id: structs.h,v 1.214 1998/08/30 05:21:43 wessels Exp $
+ * $Id: structs.h,v 1.215 1998/09/03 03:37:36 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
} netdb;
int page_faults;
int select_loops;
+ int select_fds;
+ double select_time;
double cputime;
struct timeval timestamp;
StatHist comm_icp_incoming;