/*
- * $Id: authenticate.cc,v 1.2 1998/08/20 22:29:54 wessels Exp $
+ * $Id: authenticate.cc,v 1.3 1998/09/04 23:04:38 wessels Exp $
*
* DEBUG: section 29 Authenticator
* AUTHOR: Duane Wessels
char *t = NULL;
int n;
+ Counter.syscalls.sock.reads++;
len = read(fd,
authenticator->inbuf + authenticator->offset,
authenticator->size - authenticator->offset);
/*
- * $Id: client_side.cc,v 1.390 1998/08/30 05:21:39 wessels Exp $
+ * $Id: client_side.cc,v 1.391 1998/09/04 23:04:39 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
fde *F = &fd_table[fd];
int len = conn->in.size - conn->in.offset - 1;
debug(33, 4) ("clientReadRequest: FD %d: reading request...\n", fd);
+ Counter.syscalls.sock.reads++;
size = read(fd, conn->in.buf + conn->in.offset, len);
if (size > 0) {
fd_bytes(fd, size, FD_READ);
/*
- * $Id: comm.cc,v 1.284 1998/08/18 22:42:17 wessels Exp $
+ * $Id: comm.cc,v 1.285 1998/09/04 23:04:41 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
S.sin_family = AF_INET;
S.sin_port = htons(port);
S.sin_addr = in_addr;
+ Counter.syscalls.sock.binds++;
if (bind(s, (struct sockaddr *) &S, sizeof(S)) == 0)
return COMM_OK;
debug(50, 0) ("commBind: Cannot bind socket FD %d to %s:%d: %s\n",
int tcp_rcv_bufsz = Config.tcpRcvBufsz;
/* Create socket for accepting new connections. */
+ Counter.syscalls.sock.sockets++;
if ((new_socket = socket(AF_INET, sock_type, proto)) < 0) {
/* Increase the number of reserved fd's if calls to socket()
* are failing because the open file table is full. This
int fd2;
if (!cbdataValid(cs->data))
return 0;
+ Counter.syscalls.sock.sockets++;
fd2 = socket(AF_INET, SOCK_STREAM, 0);
if (fd2 < 0) {
debug(5, 0) ("commResetFD: socket: %s\n", xstrerror());
int x;
assert(ntohs(address->sin_port) != 0);
/* Establish connection. */
+ Counter.syscalls.sock.connects++;
if (connect(sock, (struct sockaddr *) address, sizeof(struct sockaddr_in)) < 0) {
debug(5, 9) ("connect FD %d: %s\n", sock, xstrerror());
#ifdef _SQUID_HPUX_
socklen_t Slen;
fde *F = NULL;
Slen = sizeof(P);
+ Counter.syscalls.sock.accepts++;
if ((sock = accept(fd, (struct sockaddr *) &P, &Slen)) < 0) {
if (ignoreErrno(errno)) {
debug(50, 5) ("comm_accept: FD %d: %s\n", fd, xstrerror());
#else
close(fd);
#endif
+ Counter.syscalls.sock.closes++;
}
/* Send a udp datagram to specified TO_ADDR. */
int len)
{
int x;
+ Counter.syscalls.sock.sendtos++;
x = sendto(fd, buf, len, 0, (struct sockaddr *) to_addr, addr_len);
if (x < 0) {
#ifdef _SQUID_LINUX_
len = write(fd, state->buf + state->offset, nleft);
debug(5, 5) ("commHandleWrite: write() returns %d\n", len);
fd_bytes(fd, len, FD_WRITE);
+ Counter.syscalls.sock.writes++;
if (len == 0) {
/* Note we even call write if nleft == 0 */
/*
- * $Id: comm_select.cc,v 1.7 1998/09/03 03:48:39 wessels Exp $
+ * $Id: comm_select.cc,v 1.8 1998/09/04 23:04:42 wessels Exp $
*
* DEBUG: section 5 Socket Functions
*
#if !ALARM_UPDATES_TIME
getCurrentTime();
#endif
+ Counter.syscalls.polls++;
if (poll(pfds, npfds, 0) < 1)
return incame;
for (i = 0; i < npfds; i++) {
if (msec > MAX_POLL_TIME)
msec = MAX_POLL_TIME;
for (;;) {
+ Counter.syscalls.polls++;
num = poll(pfds, nfds, msec);
Counter.select_loops++;
if (num >= 0)
#if !ALARM_UPDATES_TIME
getCurrentTime();
#endif
+ Counter.syscalls.selects++;
if (select(maxfd, &read_mask, &write_mask, NULL, &zero_tv) < 1)
return incame;
for (i = 0; i < nfds; i++) {
for (;;) {
poll_time.tv_sec = msec / 1000;
poll_time.tv_usec = (msec % 1000) * 1000;
+ Counter.syscalls.selects++;
num = select(maxfd, &readfds, &writefds, NULL, &poll_time);
Counter.select_loops++;
if (num >= 0)
hdl = fd_table[fd].read_handler;
fd_table[fd].read_handler = NULL;
hdl(fd, fd_table[fd].read_data);
- Counter.select_fds++;
+ 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++;
+ Counter.select_fds++;
}
if (commCheckICPIncoming)
comm_select_icp_incoming();
FD_SET(fd, &write_x);
else
continue;
+ Counter.syscalls.selects++;
num = select(Squid_MaxFD, &read_x, &write_x, NULL, &tv);
if (num > -1) {
debug(5, 5) ("FD %d is valid.\n", fd);
/*
- * $Id: disk.cc,v 1.133 1998/08/24 22:06:44 wessels Exp $
+ * $Id: disk.cc,v 1.134 1998/09/04 23:04:43 wessels Exp $
*
* DEBUG: section 6 Disk I/O Routines
* AUTHOR: Harvest Derived
open_ctrl_t *ctrlp = (open_ctrl_t *) data;
debug(6, 5) ("fileOpenComplete: fd %d, data %p, errcode %d\n",
fd, data, errcode);
-
+ Counter.syscalls.disk.opens++;
if (fd == -2 && errcode == -2) { /* Cancelled - clean up */
if (ctrlp->callback)
(ctrlp->callback) (ctrlp->callback_data, fd, errcode);
debug(6, F->flags.close_request ? 2 : 5)
("file_close: FD %d, really closing\n", fd);
fd_close(fd);
+ Counter.syscalls.disk.closes++;
}
/*
int do_close;
errno = errcode;
debug(6, 3) ("diskHandleWriteComplete: FD %d len = %d\n", fd, len);
+ Counter.syscalls.disk.writes++;
#if USE_ASYNC_IO
/*
* From: "Michael O'Reilly" <michael@metal.iinet.net.au>
debug(6, 3) ("diskHandleRead: FD %d seeking to offset %d\n",
fd, (int) ctrl_dat->offset);
lseek(fd, ctrl_dat->offset, SEEK_SET); /* XXX ignore return? */
+ Counter.syscalls.disk.seeks++;
F->disk.offset = ctrl_dat->offset;
}
len = read(fd, ctrl_dat->buf, ctrl_dat->req_len);
#ifdef OPTIMISTIC_IO
fde *F = &fd_table[fd];
#endif /* OPTIMISTIC_IO */
+ Counter.syscalls.disk.reads++;
errno = errcode;
if (len == -2 && errcode == -2) { /* Read cancelled - cleanup */
cbdataUnlock(ctrl_dat->client_data);
/*
- * $Id: fqdncache.cc,v 1.113 1998/08/30 05:21:41 wessels Exp $
+ * $Id: fqdncache.cc,v 1.114 1998/09/04 23:04:44 wessels Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
fqdncache_entry *f = NULL;
fqdncache_entry *x = NULL;
+ Counter.syscalls.sock.reads++;
len = read(fd,
dnsData->ip_inbuf + dnsData->offset,
dnsData->size - dnsData->offset);
/*
- * $Id: ftp.cc,v 1.249 1998/08/21 19:28:57 wessels Exp $
+ * $Id: ftp.cc,v 1.250 1998/09/04 23:04:46 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
read_sz = delayBytesWanted(delay_id, 1, read_sz);
#endif
memset(ftpState->data.buf + ftpState->data.offset, '\0', read_sz);
+ Counter.syscalls.sock.reads++;
len = read(fd, ftpState->data.buf + ftpState->data.offset, read_sz);
if (len > 0) {
fd_bytes(fd, len, FD_READ);
ErrorState *err;
debug(9, 5) ("ftpReadControlReply\n");
assert(ftpState->ctrl.offset < ftpState->ctrl.size);
+ Counter.syscalls.sock.reads++;
len = read(fd,
ftpState->ctrl.buf + ftpState->ctrl.offset,
ftpState->ctrl.size - ftpState->ctrl.offset);
/*
- * $Id: gopher.cc,v 1.136 1998/08/17 16:44:06 wessels Exp $
+ * $Id: gopher.cc,v 1.137 1998/09/04 23:04:47 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
read_sz = delayBytesWanted(delay_id, 1, read_sz);
#endif
/* leave one space for \0 in gopherToHTML */
+ Counter.syscalls.sock.reads++;
len = read(fd, buf, read_sz);
if (len > 0) {
fd_bytes(fd, len, FD_READ);
/*
- * $Id: htcp.cc,v 1.21 1998/09/01 23:32:44 wessels Exp $
+ * $Id: htcp.cc,v 1.22 1998/09/04 23:04:48 wessels Exp $
*
* DEBUG: section 31 Hypertext Caching Protocol
* AUTHOR: Duane Wesssels
}
static void
-htcpTstReply(htcpDataHeader *dhdr, StoreEntry * e, htcpSpecifier * spec, struct sockaddr_in *from)
+htcpTstReply(htcpDataHeader * dhdr, StoreEntry * e, htcpSpecifier * spec, struct sockaddr_in *from)
{
htcpStuff stuff;
char *pkt;
squid_curtime - e->timestamp : 0);
httpHeaderPackInto(&hdr, &p);
stuff.D.resp_hdrs = xstrdup(mb.buf);
- debug(31,1)("htcpTstReply: resp_hdrs = {%s}\n", stuff.D.resp_hdrs);
+ debug(31, 1) ("htcpTstReply: resp_hdrs = {%s}\n", stuff.D.resp_hdrs);
memBufReset(&mb);
httpHeaderReset(&hdr);
if (e->expires > -1)
httpHeaderPutTime(&hdr, HDR_LAST_MODIFIED, e->lastmod);
httpHeaderPackInto(&hdr, &p);
stuff.D.entity_hdrs = xstrdup(mb.buf);
- debug(31,1)("htcpTstReply: entity_hdrs = {%s}\n", stuff.D.entity_hdrs);
+ debug(31, 1) ("htcpTstReply: entity_hdrs = {%s}\n", stuff.D.entity_hdrs);
memBufReset(&mb);
httpHeaderReset(&hdr);
if ((host = urlHostname(spec->uri))) {
netdbHostData(host, &samp, &rtt, &hops);
if (rtt || hops) {
snprintf(cto_buf, 128, "%s %d %f %d",
- host, samp, 0.001 * rtt, hops);
+ host, samp, 0.001 * rtt, hops);
httpHeaderPutExt(&hdr, "Cache-to-Origin", cto_buf);
}
}
httpHeaderPackInto(&hdr, &p);
stuff.D.cache_hdrs = xstrdup(mb.buf);
- debug(31,1)("htcpTstReply: cache_hdrs = {%s}\n", stuff.D.cache_hdrs);
+ debug(31, 1) ("htcpTstReply: cache_hdrs = {%s}\n", stuff.D.cache_hdrs);
memBufClean(&mb);
httpHeaderClean(&hdr);
packerClean(&p);
htcpDetail *d = NULL;
char *t;
if (hdr->F1 == 1) {
- debug(31,1)("htcpHandleTstResponse: error condition, F1/MO == 1\n");
+ debug(31, 1) ("htcpHandleTstResponse: error condition, F1/MO == 1\n");
return;
}
memset(&htcpReply, '\0', sizeof(htcpReply));
httpHeaderInit(&htcpReply.hdr, hoHtcpReply);
htcpReply.msg_id = hdr->msg_id;
- debug(31,1)("htcpHandleTstResponse: msg_id = %d\n", (int) htcpReply.msg_id);
+ debug(31, 1) ("htcpHandleTstResponse: msg_id = %d\n", (int) htcpReply.msg_id);
htcpReply.hit = hdr->response ? 0 : 1;
if (hdr->F1) {
debug(31, 1) ("htcpHandleTstResponse: MISS\n");
httpHeaderParse(&htcpReply.hdr, t, t + strlen(t));
}
key = queried_keys[htcpReply.msg_id % N_QUERIED_KEYS];
- debug(31,1)("htcpHandleTstResponse: key (%p) %s\n", key, storeKeyText(key));
+ debug(31, 1) ("htcpHandleTstResponse: key (%p) %s\n", key, storeKeyText(key));
neighborsHtcpReply(key, &htcpReply, from);
if (d)
- htcpFreeDetail(d);
+ htcpFreeDetail(d);
}
static void
-htcpHandleTstRequest(htcpDataHeader *dhdr, char *buf, int sz, struct sockaddr_in *from)
+htcpHandleTstRequest(htcpDataHeader * dhdr, char *buf, int sz, struct sockaddr_in *from)
{
/* buf should be a SPECIFIER */
htcpSpecifier *s;
static struct sockaddr_in from;
int flen = sizeof(struct sockaddr_in);
memset(&from, '\0', flen);
+ Counter.syscalls.sock.recvfroms++;
len = recvfrom(fd, buf, 8192, 0, (struct sockaddr *) &from, &flen);
debug(31, 1) ("htcpRecv: FD %d, %d bytes from %s:%d\n",
fd, len, inet_ntoa(from.sin_addr), ntohs(from.sin_port));
htcpSend(pkt, (int) pktlen, &p->in_addr);
save_key = queried_keys[stuff.msg_id % N_QUERIED_KEYS];
storeKeyCopy(save_key, e->key);
- debug(31,1)("htcpQuery: key (%p) %s\n", save_key, storeKeyText(save_key));
+ debug(31, 1) ("htcpQuery: key (%p) %s\n", save_key, storeKeyText(save_key));
xfree(pkt);
}
/*
- * $Id: http.cc,v 1.313 1998/08/21 08:40:57 wessels Exp $
+ * $Id: http.cc,v 1.314 1998/09/04 23:04:50 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
#if DELAY_POOLS
read_sz = delayBytesWanted(delay_id, 1, read_sz);
#endif
+ Counter.syscalls.sock.reads++;
len = read(fd, buf, read_sz);
debug(11, 5) ("httpReadReply: FD %d: len %d.\n", fd, len);
if (len > 0) {
/*
- * $Id: icmp.cc,v 1.62 1998/08/05 06:05:01 wessels Exp $
+ * $Id: icmp.cc,v 1.63 1998/09/04 23:04:51 wessels Exp $
*
* DEBUG: section 37 ICMP Routines
* AUTHOR: Duane Wessels
static struct sockaddr_in F;
commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0);
memset(&preply, '\0', sizeof(pingerReplyData));
+ Counter.syscalls.sock.recvfroms++;
n = recv(icmp_sock,
(char *) &preply,
sizeof(pingerReplyData),
/*
- * $Id: icp_v2.cc,v 1.49 1998/08/18 19:14:02 wessels Exp $
+ * $Id: icp_v2.cc,v 1.50 1998/09/04 23:04:52 wessels Exp $
*
* DEBUG: section 12 Internet Cache Protocol
* AUTHOR: Duane Wessels
while (max--) {
from_len = sizeof(from);
memset(&from, '\0', from_len);
+ Counter.syscalls.sock.recvfroms++;
len = recvfrom(sock,
buf,
SQUID_UDP_SO_RCVBUF - 1,
/*
- * $Id: ident.cc,v 1.44 1998/07/22 20:37:29 wessels Exp $
+ * $Id: ident.cc,v 1.45 1998/09/04 23:04:53 wessels Exp $
*
* DEBUG: section 30 Ident (RFC 931)
* AUTHOR: Duane Wessels
int len = -1;
buf[0] = '\0';
+ Counter.syscalls.sock.reads++;
len = read(fd, buf, BUFSIZ);
fd_bytes(fd, len, FD_READ);
if (len > 0) {
/*
- * $Id: ipcache.cc,v 1.199 1998/08/21 08:41:57 wessels Exp $
+ * $Id: ipcache.cc,v 1.200 1998/09/04 23:04:54 wessels Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
ipcache_entry *i = NULL;
ipcache_entry *x = NULL;
+ Counter.syscalls.sock.reads++;
len = read(fd,
dnsData->ip_inbuf + dnsData->offset,
dnsData->size - dnsData->offset);
/*
- * $Id: pconn.cc,v 1.23 1998/08/14 18:02:49 wessels Exp $
+ * $Id: pconn.cc,v 1.24 1998/09/04 23:04:56 wessels Exp $
*
* DEBUG: section 48 Persistent Connections
* AUTHOR: Duane Wessels
struct _pconn *p = data;
int n;
assert(table != NULL);
+ Counter.syscalls.sock.reads++;
n = read(fd, buf, 256);
debug(48, 3) ("pconnRead: %d bytes from FD %d, %s\n", n, fd, p->key);
pconnRemoveFD(p, fd);
/*
- * $Id: redirect.cc,v 1.64 1998/07/25 00:16:29 wessels Exp $
+ * $Id: redirect.cc,v 1.65 1998/09/04 23:04:58 wessels Exp $
*
* DEBUG: section 29 Redirector
* AUTHOR: Duane Wessels
char *t = NULL;
int n;
+ Counter.syscalls.sock.reads++;
len = read(fd,
redirector->inbuf + redirector->offset,
redirector->size - redirector->offset);
/*
- * $Id: snmp_core.cc,v 1.9 1998/08/18 19:14:08 wessels Exp $
+ * $Id: snmp_core.cc,v 1.10 1998/09/04 23:04:59 wessels Exp $
*
* DEBUG: section 49 SNMP support
* AUTHOR: Kostas Anagnostakis
commSetSelect(sock, COMM_SELECT_READ, snmpHandleUdp, NULL, 0);
from_len = sizeof(struct sockaddr_in);
memset(&from, '\0', from_len);
+ Counter.syscalls.sock.recvfroms++;
len = recvfrom(sock,
buf,
SNMP_REQUEST_SIZE,
/*
- * $Id: ssl.cc,v 1.88 1998/08/20 22:30:01 wessels Exp $
+ * $Id: ssl.cc,v 1.89 1998/09/04 23:05:00 wessels Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
#if DELAY_POOLS
read_sz = delayBytesWanted(sslState->request->delay_id, 1, read_sz);
#endif
+ Counter.syscalls.sock.reads++;
len = read(fd, sslState->server.buf + sslState->server.len, read_sz);
debug(26, 3) ("sslReadServer: FD %d, read %d bytes\n", fd, len);
if (len > 0) {
debug(26, 3) ("sslReadClient: FD %d, reading %d bytes at offset %d\n",
fd, SQUID_TCP_SO_RCVBUF - sslState->client.len,
sslState->client.len);
+ Counter.syscalls.sock.reads++;
len = read(fd,
sslState->client.buf + sslState->client.len,
SQUID_TCP_SO_RCVBUF - sslState->client.len);
assert(fd == sslState->server.fd);
debug(26, 3) ("sslWriteServer: FD %d, %d bytes to write\n",
fd, sslState->client.len);
+ Counter.syscalls.sock.writes++;
len = write(fd,
sslState->client.buf,
sslState->client.len);
assert(fd == sslState->client.fd);
debug(26, 3) ("sslWriteClient: FD %d, %d bytes to write\n",
fd, sslState->server.len);
+ Counter.syscalls.sock.writes++;
len = write(fd,
sslState->server.buf,
sslState->server.len);
/*
- * $Id: stat.cc,v 1.283 1998/09/03 03:48:36 wessels Exp $
+ * $Id: stat.cc,v 1.284 1998/09/04 23:05:02 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
: 0.0);
x = statHistDeltaMedian(&l->select_fds_hist, &f->select_fds_hist);
storeAppendPrintf(sentry, "median_select_fds = %f\n", x);
-
+
+#if HAVE_POLL
+ storeAppendPrintf(sentry, "syscalls.polls = %f/sec\n", XAVG(syscalls.polls));
+#else
+ storeAppendPrintf(sentry, "syscalls.selects = %f/sec\n", XAVG(syscalls.selects));
+#endif
+ storeAppendPrintf(sentry, "syscalls.disk.opens = %f/sec\n", XAVG(syscalls.disk.opens));
+ storeAppendPrintf(sentry, "syscalls.disk.closes = %f/sec\n", XAVG(syscalls.disk.closes));
+ storeAppendPrintf(sentry, "syscalls.disk.reads = %f/sec\n", XAVG(syscalls.disk.reads));
+ storeAppendPrintf(sentry, "syscalls.disk.writes = %f/sec\n", XAVG(syscalls.disk.writes));
+ storeAppendPrintf(sentry, "syscalls.disk.seeks = %f/sec\n", XAVG(syscalls.disk.seeks));
+ storeAppendPrintf(sentry, "syscalls.sock.accepts = %f/sec\n", XAVG(syscalls.sock.accepts));
+ storeAppendPrintf(sentry, "syscalls.sock.sockets = %f/sec\n", XAVG(syscalls.sock.sockets));
+ storeAppendPrintf(sentry, "syscalls.sock.connects = %f/sec\n", XAVG(syscalls.sock.connects));
+ storeAppendPrintf(sentry, "syscalls.sock.binds = %f/sec\n", XAVG(syscalls.sock.binds));
+ storeAppendPrintf(sentry, "syscalls.sock.closes = %f/sec\n", XAVG(syscalls.sock.closes));
+ storeAppendPrintf(sentry, "syscalls.sock.reads = %f/sec\n", XAVG(syscalls.sock.reads));
+ storeAppendPrintf(sentry, "syscalls.sock.writes = %f/sec\n", XAVG(syscalls.sock.writes));
+ storeAppendPrintf(sentry, "syscalls.sock.recvfroms = %f/sec\n", XAVG(syscalls.sock.recvfroms));
+ storeAppendPrintf(sentry, "syscalls.sock.sendtos = %f/sec\n", XAVG(syscalls.sock.sendtos));
+
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));
+
/*
- * $Id: store_rebuild.cc,v 1.46 1998/08/24 22:06:48 wessels Exp $
+ * $Id: store_rebuild.cc,v 1.47 1998/09/04 23:05:03 wessels Exp $
*
* DEBUG: section 20 Store Rebuild Routines
* AUTHOR: Duane Wessels
debug(20, 1) (" %7d files opened so far.\n",
RebuildState.statcount);
debug(20, 9) ("file_in: fd=%d %08X\n", fd, sfileno);
+ Counter.syscalls.disk.reads++;
if (read(fd, hdr_buf, DISK_PAGE_SIZE) < 0) {
debug(20, 1) ("storeRebuildFromDirectory: read(FD %d): %s\n",
fd, xstrerror());
/*
- * $Id: structs.h,v 1.216 1998/09/03 03:48:37 wessels Exp $
+ * $Id: structs.h,v 1.217 1998/09/04 23:05:04 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
int logged_state; /* so we can print dead/revived msgs */
} stats;
struct {
- int version;
+ int version;
int counts[ICP_END];
- u_short port;
+ u_short port;
} icp;
#if USE_HTCP
struct {
double version;
int counts[2];
- u_short port;
+ u_short port;
} htcp;
#endif
u_short http_port;
unsigned int used_proxy_auth:1;
unsigned int redirected:1;
#if HTTP_VIOLATIONS
- unsigned int nocache_hack:1; /* for changing/ignoring no-cache requests */
+ unsigned int nocache_hack:1; /* for changing/ignoring no-cache requests */
#endif
};
StatHist comm_icp_incoming;
StatHist comm_http_incoming;
StatHist select_fds_hist;
+ struct {
+ struct {
+ int opens;
+ int closes;
+ int reads;
+ int writes;
+ int seeks;
+ } disk;
+ struct {
+ int accepts;
+ int sockets;
+ int connects;
+ int binds;
+ int closes;
+ int reads;
+ int writes;
+ int recvfroms;
+ int sendtos;
+ } sock;
+#if HAVE_POLL
+ int polls;
+#else
+ int selects;
+#endif
+ } syscalls;
};
/* per header statistics */
#if USE_HTCP
struct _htcpReplyData {
- int hit;
- HttpHeader hdr;
- u_num32 msg_id;
- double version;
- struct {
+ int hit;
+ HttpHeader hdr;
+ u_num32 msg_id;
+ double version;
+ struct {
/* cache-to-origin */
- double rtt;
- int samp;
- int hops;
- } cto;
+ double rtt;
+ int samp;
+ int hops;
+ } cto;
};
+
#endif
/*
- * $Id: tunnel.cc,v 1.88 1998/08/20 22:30:01 wessels Exp $
+ * $Id: tunnel.cc,v 1.89 1998/09/04 23:05:00 wessels Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
#if DELAY_POOLS
read_sz = delayBytesWanted(sslState->request->delay_id, 1, read_sz);
#endif
+ Counter.syscalls.sock.reads++;
len = read(fd, sslState->server.buf + sslState->server.len, read_sz);
debug(26, 3) ("sslReadServer: FD %d, read %d bytes\n", fd, len);
if (len > 0) {
debug(26, 3) ("sslReadClient: FD %d, reading %d bytes at offset %d\n",
fd, SQUID_TCP_SO_RCVBUF - sslState->client.len,
sslState->client.len);
+ Counter.syscalls.sock.reads++;
len = read(fd,
sslState->client.buf + sslState->client.len,
SQUID_TCP_SO_RCVBUF - sslState->client.len);
assert(fd == sslState->server.fd);
debug(26, 3) ("sslWriteServer: FD %d, %d bytes to write\n",
fd, sslState->client.len);
+ Counter.syscalls.sock.writes++;
len = write(fd,
sslState->client.buf,
sslState->client.len);
assert(fd == sslState->client.fd);
debug(26, 3) ("sslWriteClient: FD %d, %d bytes to write\n",
fd, sslState->server.len);
+ Counter.syscalls.sock.writes++;
len = write(fd,
sslState->server.buf,
sslState->server.len);
/*
- * $Id: wais.cc,v 1.117 1998/08/17 16:44:14 wessels Exp $
+ * $Id: wais.cc,v 1.118 1998/09/04 23:05:06 wessels Exp $
*
* DEBUG: section 24 WAIS Relay
* AUTHOR: Harvest Derived
#if DELAY_POOLS
read_sz = delayBytesWanted(delay_id, 1, read_sz);
#endif
+ Counter.syscalls.sock.reads++;
len = read(fd, buf, read_sz);
if (len > 0) {
fd_bytes(fd, len, FD_READ);
/*
- * $Id: whois.cc,v 1.5 1998/07/22 20:38:07 wessels Exp $
+ * $Id: whois.cc,v 1.6 1998/09/04 23:05:07 wessels Exp $
*
* DEBUG: section 75 WHOIS protocol
* AUTHOR: Duane Wessels, Kostas Anagnostakis
StoreEntry *entry = p->entry;
char *buf = memAllocate(MEM_4K_BUF);
int len;
+ Counter.syscalls.sock.reads++;
len = read(fd, buf, 4095);
buf[len] = '\0';
debug(75, 3) ("whoisReadReply: FD %d read %d bytes\n", fd, len);