/*
- * $Id: CacheDigest.cc,v 1.30 2000/03/06 16:23:27 wessels Exp $
+ * $Id: CacheDigest.cc,v 1.31 2000/06/27 22:05:58 hno Exp $
*
* DEBUG: section 70 Cache Digest
* AUTHOR: Alex Rousskov
CBIT_SET(cd->mask, hashed_keys[3]);
on_xition_cnt++;
}
- statHistCount(&Counter.cd.on_xition_count, on_xition_cnt);
+ statHistCount(&statCounter.cd.on_xition_count, on_xition_cnt);
}
#endif
cd->count++;
/*
- * $Id: client_db.cc,v 1.49 2000/05/16 07:06:03 wessels Exp $
+ * $Id: client_db.cc,v 1.50 2000/06/27 22:05:58 hno Exp $
*
* DEBUG: section 0 Client Database
* AUTHOR: Duane Wessels
c->key = xstrdup(inet_ntoa(addr));
c->addr = addr;
hash_join(client_table, (hash_link *) c);
- Counter.client_http.clients++;
+ statCounter.client_http.clients++;
return c;
}
/*
- * $Id: client_side.cc,v 1.489 2000/05/31 04:59:23 wessels Exp $
+ * $Id: client_side.cc,v 1.490 2000/06/27 22:05:59 hno Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
int svc_time = tvSubMsec(http->start, current_time);
ping_data *i;
HierarchyLogEntry *H;
- Counter.client_http.requests++;
+ statCounter.client_http.requests++;
if (isTcpHit(http->log_type))
- Counter.client_http.hits++;
+ statCounter.client_http.hits++;
if (http->log_type == LOG_TCP_HIT)
- Counter.client_http.disk_hits++;
+ statCounter.client_http.disk_hits++;
else if (http->log_type == LOG_TCP_MEM_HIT)
- Counter.client_http.mem_hits++;
+ statCounter.client_http.mem_hits++;
if (http->request->err_type != ERR_NONE)
- Counter.client_http.errors++;
- statHistCount(&Counter.client_http.all_svc_time, svc_time);
+ statCounter.client_http.errors++;
+ statHistCount(&statCounter.client_http.all_svc_time, svc_time);
/*
* The idea here is not to be complete, but to get service times
* for only well-defined types. For example, we don't include
*/
switch (http->log_type) {
case LOG_TCP_REFRESH_HIT:
- statHistCount(&Counter.client_http.nh_svc_time, svc_time);
+ statHistCount(&statCounter.client_http.nh_svc_time, svc_time);
break;
case LOG_TCP_IMS_HIT:
- statHistCount(&Counter.client_http.nm_svc_time, svc_time);
+ statHistCount(&statCounter.client_http.nm_svc_time, svc_time);
break;
case LOG_TCP_HIT:
case LOG_TCP_MEM_HIT:
case LOG_TCP_OFFLINE_HIT:
- statHistCount(&Counter.client_http.hit_svc_time, svc_time);
+ statHistCount(&statCounter.client_http.hit_svc_time, svc_time);
break;
case LOG_TCP_MISS:
case LOG_TCP_CLIENT_REFRESH_MISS:
- statHistCount(&Counter.client_http.miss_svc_time, svc_time);
+ statHistCount(&statCounter.client_http.miss_svc_time, svc_time);
break;
default:
/* make compiler warnings go away */
H = &http->request->hier;
switch (H->alg) {
case PEER_SA_DIGEST:
- Counter.cd.times_used++;
+ statCounter.cd.times_used++;
break;
case PEER_SA_ICP:
- Counter.icp.times_used++;
+ statCounter.icp.times_used++;
i = &H->ping;
if (0 != i->stop.tv_sec && 0 != i->start.tv_sec)
- statHistCount(&Counter.icp.query_svc_time,
+ statHistCount(&statCounter.icp.query_svc_time,
tvSubUsec(i->start, i->stop));
if (i->timeout)
- Counter.icp.query_timeouts++;
+ statCounter.icp.query_timeouts++;
break;
case PEER_SA_NETDB:
- Counter.netdb.times_used++;
+ statCounter.netdb.times_used++;
break;
default:
break;
debug(33, 5) ("clientWriteComplete: FD %d, sz %d, err %d, off %d, len %d\n",
fd, size, errflag, (int) http->out.offset, entry ? objectLen(entry) : 0);
if (size > 0) {
- kb_incr(&Counter.client_http.kbytes_out, size);
+ kb_incr(&statCounter.client_http.kbytes_out, size);
if (isTcpHit(http->log_type))
- kb_incr(&Counter.client_http.hit_kbytes_out, size);
+ kb_incr(&statCounter.client_http.hit_kbytes_out, size);
}
if (errflag) {
/*
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++;
+ statCounter.syscalls.sock.reads++;
size = read(fd, conn->in.buf + conn->in.offset, len);
if (size > 0) {
fd_bytes(fd, size, FD_READ);
- kb_incr(&Counter.client_http.kbytes_in, size);
+ kb_incr(&statCounter.client_http.kbytes_in, size);
}
/*
* Don't reset the timeout value here. The timeout value will be
/*
- * $Id: comm.cc,v 1.305 2000/03/06 16:23:30 wessels Exp $
+ * $Id: comm.cc,v 1.306 2000/06/27 22:06:00 hno 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++;
+ statCounter.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",
fde *F = NULL;
/* Create socket for accepting new connections. */
- Counter.syscalls.sock.sockets++;
+ statCounter.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++;
+ statCounter.syscalls.sock.sockets++;
fd2 = socket(AF_INET, SOCK_STREAM, 0);
- Counter.syscalls.sock.sockets++;
+ statCounter.syscalls.sock.sockets++;
if (fd2 < 0) {
debug(5, 0) ("commResetFD: socket: %s\n", xstrerror());
if (ENFILE == errno || EMFILE == errno)
errno = 0;
if (!F->flags.called_connect) {
F->flags.called_connect = 1;
- Counter.syscalls.sock.connects++;
+ statCounter.syscalls.sock.connects++;
x = connect(sock, (struct sockaddr *) address, sizeof(*address));
if (x < 0)
debug(5, 9) ("connect FD %d: %s\n", sock, xstrerror());
socklen_t Slen;
fde *F = NULL;
Slen = sizeof(P);
- Counter.syscalls.sock.accepts++;
+ statCounter.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());
pconnHistCount(1, F->uses);
fd_close(fd); /* update fdstat */
close(fd);
- Counter.syscalls.sock.closes++;
+ statCounter.syscalls.sock.closes++;
}
/* Send a udp datagram to specified TO_ADDR. */
int len)
{
int x;
- Counter.syscalls.sock.sendtos++;
+ statCounter.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++;
+ statCounter.syscalls.sock.writes++;
if (len == 0) {
/* Note we even call write if nleft == 0 */
/*
- * $Id: comm_select.cc,v 1.44 2000/05/28 16:21:45 wessels Exp $
+ * $Id: comm_select.cc,v 1.45 2000/06/27 22:06:00 hno Exp $
*
* DEBUG: section 5 Socket Functions
*
#if !ALARM_UPDATES_TIME
getCurrentTime();
#endif
- Counter.syscalls.polls++;
+ statCounter.syscalls.polls++;
if (poll(pfds, npfds, 0) < 1)
return incame;
for (i = 0; i < npfds; i++) {
incoming_icp_interval = MAX_INCOMING_INTERVAL;
if (nevents > INCOMING_ICP_MAX)
nevents = INCOMING_ICP_MAX;
- statHistCount(&Counter.comm_icp_incoming, nevents);
+ statHistCount(&statCounter.comm_icp_incoming, nevents);
}
static void
incoming_http_interval = MAX_INCOMING_INTERVAL;
if (nevents > INCOMING_HTTP_MAX)
nevents = INCOMING_HTTP_MAX;
- statHistCount(&Counter.comm_http_incoming, nevents);
+ statHistCount(&statCounter.comm_http_incoming, nevents);
}
/* poll all sockets; call handlers for those that are ready. */
if (msec > MAX_POLL_TIME)
msec = MAX_POLL_TIME;
for (;;) {
- Counter.syscalls.polls++;
+ statCounter.syscalls.polls++;
num = poll(pfds, nfds, msec);
- Counter.select_loops++;
+ statCounter.select_loops++;
if (num >= 0)
break;
if (ignoreErrno(errno))
/* NOTREACHED */
}
debug(5, num ? 5 : 8) ("comm_poll: %d FDs ready\n", num);
- statHistCount(&Counter.select_fds_hist, num);
+ statHistCount(&statCounter.select_fds_hist, num);
/* Check timeout handlers ONCE each second. */
if (squid_curtime > last_timeout) {
last_timeout = squid_curtime;
else {
F->read_handler = NULL;
hdl(fd, F->read_data);
- Counter.select_fds++;
+ statCounter.select_fds++;
if (commCheckICPIncoming)
comm_poll_icp_incoming();
if (commCheckDNSIncoming)
if ((hdl = F->write_handler)) {
F->write_handler = NULL;
hdl(fd, F->write_data);
- Counter.select_fds++;
+ statCounter.select_fds++;
if (commCheckICPIncoming)
comm_poll_icp_incoming();
if (commCheckDNSIncoming)
if ((hdl = F->read_handler)) {
F->read_handler = NULL;
hdl(fd, F->read_data);
- Counter.select_fds++;
+ statCounter.select_fds++;
if (commCheckICPIncoming)
comm_poll_icp_incoming();
if (commCheckDNSIncoming)
#endif
#if !ALARM_UPDATES_TIME
getCurrentTime();
- Counter.select_time += (current_dtime - start);
+ statCounter.select_time += (current_dtime - start);
#endif
return COMM_OK;
}
#if !ALARM_UPDATES_TIME
getCurrentTime();
#endif
- Counter.syscalls.selects++;
+ statCounter.syscalls.selects++;
if (select(maxfd, &read_mask, &write_mask, NULL, &zero_tv) < 1)
return incame;
for (i = 0; i < nfds; i++) {
incoming_icp_interval = MAX_INCOMING_INTERVAL;
if (nevents > INCOMING_ICP_MAX)
nevents = INCOMING_ICP_MAX;
- statHistCount(&Counter.comm_icp_incoming, nevents);
+ statHistCount(&statCounter.comm_icp_incoming, nevents);
}
static void
incoming_http_interval = MAX_INCOMING_INTERVAL;
if (nevents > INCOMING_HTTP_MAX)
nevents = INCOMING_HTTP_MAX;
- statHistCount(&Counter.comm_http_incoming, nevents);
+ statHistCount(&statCounter.comm_http_incoming, nevents);
}
#define DEBUG_FDBITS 0
for (;;) {
poll_time.tv_sec = msec / 1000;
poll_time.tv_usec = (msec % 1000) * 1000;
- Counter.syscalls.selects++;
+ statCounter.syscalls.selects++;
num = select(maxfd, &readfds, &writefds, NULL, &poll_time);
- Counter.select_loops++;
+ statCounter.select_loops++;
if (num >= 0)
break;
if (ignoreErrno(errno))
continue;
debug(5, num ? 5 : 8) ("comm_select: %d FDs ready at %d\n",
num, (int) squid_curtime);
- statHistCount(&Counter.select_fds_hist, num);
+ statHistCount(&statCounter.select_fds_hist, num);
/* Check lifetime and timeout handlers ONCE each second.
* Replaces brain-dead check every time through the loop! */
if (squid_curtime > last_timeout) {
F->read_handler = NULL;
commUpdateReadBits(fd, NULL);
hdl(fd, F->read_data);
- Counter.select_fds++;
+ statCounter.select_fds++;
if (commCheckICPIncoming)
comm_select_icp_incoming();
if (commCheckDNSIncoming)
F->write_handler = NULL;
commUpdateWriteBits(fd, NULL);
hdl(fd, F->write_data);
- Counter.select_fds++;
+ statCounter.select_fds++;
if (commCheckICPIncoming)
comm_select_icp_incoming();
if (commCheckDNSIncoming)
F->read_handler = NULL;
commUpdateReadBits(fd, NULL);
hdl(fd, F->read_data);
- Counter.select_fds++;
+ statCounter.select_fds++;
if (commCheckICPIncoming)
comm_select_icp_incoming();
if (commCheckDNSIncoming)
incoming_dns_interval = MAX_INCOMING_INTERVAL;
if (nevents > INCOMING_DNS_MAX)
nevents = INCOMING_DNS_MAX;
- statHistCount(&Counter.comm_dns_incoming, nevents);
+ statHistCount(&statCounter.comm_dns_incoming, nevents);
}
void
FD_SET(fd, &write_x);
else
continue;
- Counter.syscalls.selects++;
+ statCounter.syscalls.selects++;
errno = 0;
if (!fstat(fd, &sb)) {
debug(5, 5) ("FD %d is valid.\n", fd);
static void
commIncomingStats(StoreEntry * sentry)
{
- StatCounters *f = &Counter;
+ StatCounters *f = &statCounter;
storeAppendPrintf(sentry, "Current incoming_icp_interval: %d\n",
incoming_icp_interval >> INCOMING_FACTOR);
storeAppendPrintf(sentry, "Current incoming_dns_interval: %d\n",
/*
- * $Id: disk.cc,v 1.149 2000/05/12 00:29:07 wessels Exp $
+ * $Id: disk.cc,v 1.150 2000/06/27 22:06:00 hno Exp $
*
* DEBUG: section 6 Disk I/O Routines
* AUTHOR: Harvest Derived
mode |= SQUID_NONBLOCK;
errno = 0;
fd = open(path, mode, 0644);
- Counter.syscalls.disk.opens++;
+ statCounter.syscalls.disk.opens++;
if (fd < 0) {
debug(50, 3) ("file_open: error opening file %s: %s\n", path,
xstrerror());
debug(6, F->flags.close_request ? 2 : 5)
("file_close: FD %d, really closing\n", fd);
fd_close(fd);
- Counter.syscalls.disk.closes++;
+ statCounter.syscalls.disk.closes++;
}
/*
fdd->write_q->buf + fdd->write_q->buf_offset,
fdd->write_q->len - fdd->write_q->buf_offset);
debug(6, 3) ("diskHandleWrite: FD %d len = %d\n", fd, len);
- Counter.syscalls.disk.writes++;
+ statCounter.syscalls.disk.writes++;
fd_bytes(fd, len, FD_WRITE);
if (len < 0) {
if (!ignoreErrno(errno)) {
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++;
+ statCounter.syscalls.disk.seeks++;
F->disk.offset = ctrl_dat->offset;
}
errno = 0;
len = read(fd, ctrl_dat->buf, ctrl_dat->req_len);
if (len > 0)
F->disk.offset += len;
- Counter.syscalls.disk.reads++;
+ statCounter.syscalls.disk.reads++;
fd_bytes(fd, len, FD_READ);
if (len < 0) {
if (ignoreErrno(errno)) {
/*
- * $Id: dns_internal.cc,v 1.28 2000/06/25 21:22:47 wessels Exp $
+ * $Id: dns_internal.cc,v 1.29 2000/06/27 22:06:01 hno Exp $
*
* DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c
* AUTHOR: Duane Wessels
while (max--) {
from_len = sizeof(from);
memset(&from, '\0', from_len);
- Counter.syscalls.sock.recvfroms++;
+ statCounter.syscalls.sock.recvfroms++;
len = recvfrom(fd, rbuf, 512, 0, (struct sockaddr *) &from, &from_len);
if (len == 0)
break;
/*
- * $Id: fqdncache.cc,v 1.134 2000/06/06 19:34:31 hno Exp $
+ * $Id: fqdncache.cc,v 1.135 2000/06/27 22:06:01 hno Exp $
*
* DEBUG: section 35 FQDN Cache
* AUTHOR: Harvest Derived
cbdataFree(c);
c = NULL;
n = ++FqdncacheStats.replies;
- statHistCount(&Counter.dns.svc_time,
+ statHistCount(&statCounter.dns.svc_time,
tvSubMsec(f->request_time, current_time));
#if USE_DNSSERVERS
x = fqdncacheParse(reply);
/*
- * $Id: store_dir_aufs.cc,v 1.6 2000/06/27 08:33:53 hno Exp $
+ * $Id: store_dir_aufs.cc,v 1.7 2000/06/27 22:06:23 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
debug(20, 3) (" %s %7d files opened so far.\n",
rb->sd->path, rb->counts.scancount);
debug(20, 9) ("file_in: fd=%d %08X\n", fd, sfileno);
- Counter.syscalls.disk.reads++;
+ statCounter.syscalls.disk.reads++;
if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
debug(20, 1) ("storeAufsDirRebuildFromDirectory: read(FD %d): %s\n",
fd, xstrerror());
#else
safeunlink(p2, 0);
#endif
- Counter.swap.files_cleaned++;
+ statCounter.swap.files_cleaned++;
}
debug(36, 3) ("Cleaned %d unused files from %s\n", k, p1);
return k;
/*
- * $Id: store_dir_diskd.cc,v 1.14 2000/06/26 07:17:55 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.15 2000/06/27 22:06:23 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
debug(20, 3) (" %s %7d files opened so far.\n",
rb->sd->path, rb->counts.scancount);
debug(20, 9) ("file_in: fd=%d %08X\n", fd, sfileno);
- Counter.syscalls.disk.reads++;
+ statCounter.syscalls.disk.reads++;
if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
debug(20, 1) ("storeDiskdDirRebuildFromDirectory: read(FD %d): %s\n",
fd, xstrerror());
#else
safeunlink(p2, 0);
#endif
- Counter.swap.files_cleaned++;
+ statCounter.swap.files_cleaned++;
}
debug(36, 3) ("Cleaned %d unused files from %s\n", k, p1);
return k;
/*
- * $Id: store_io_diskd.cc,v 1.11 2000/06/26 03:19:47 wessels Exp $
+ * $Id: store_io_diskd.cc,v 1.12 2000/06/27 22:06:25 hno Exp $
*
* DEBUG: section 81 Squid-side DISKD I/O functions.
* AUTHOR: Duane Wessels
storeDiskdOpenDone(diomsg * M)
{
storeIOState *sio = M->callback_data;
- Counter.syscalls.disk.opens++;
+ statCounter.syscalls.disk.opens++;
debug(81, 3) ("storeDiskdOpenDone: dirno %d, fileno %08x status %d\n",
sio->swap_dirn, sio->swap_filen, M->status);
if (M->status < 0) {
storeDiskdCloseDone(diomsg * M)
{
storeIOState *sio = M->callback_data;
- Counter.syscalls.disk.closes++;
+ statCounter.syscalls.disk.closes++;
debug(81, 3) ("storeDiskdCloseDone: dirno %d, fileno %08x status %d\n",
sio->swap_dirn, sio->swap_filen, M->status);
if (M->status < 0) {
char *sbuf;
size_t len;
int valid;
- Counter.syscalls.disk.reads++;
+ statCounter.syscalls.disk.reads++;
diskdstate->flags.reading = 0;
valid = cbdataValid(sio->read.callback_data);
cbdataUnlock(sio->read.callback_data);
{
storeIOState *sio = M->callback_data;
diskdstate_t *diskdstate = sio->fsstate;
- Counter.syscalls.disk.writes++;
+ statCounter.syscalls.disk.writes++;
diskdstate->flags.writing = 0;
debug(81, 3) ("storeDiskdWriteDone: dirno %d, fileno %08x status %d\n",
sio->swap_dirn, sio->swap_filen, M->status);
{
debug(81, 3) ("storeDiskdUnlinkDone: fileno %08x status %d\n",
M->id, M->status);
- Counter.syscalls.disk.unlinks++;
+ statCounter.syscalls.disk.unlinks++;
}
void
/*
- * $Id: store_dir_ufs.cc,v 1.6 2000/06/26 03:36:15 wessels Exp $
+ * $Id: store_dir_ufs.cc,v 1.7 2000/06/27 22:06:26 hno Exp $
*
* DEBUG: section 47 Store Directory Routines
* AUTHOR: Duane Wessels
debug(20, 3) (" %s %7d files opened so far.\n",
rb->sd->path, rb->counts.scancount);
debug(20, 9) ("file_in: fd=%d %08X\n", fd, sfileno);
- Counter.syscalls.disk.reads++;
+ statCounter.syscalls.disk.reads++;
if (read(fd, hdr_buf, SM_PAGE_SIZE) < 0) {
debug(20, 1) ("storeUfsDirRebuildFromDirectory: read(FD %d): %s\n",
fd, xstrerror());
#else
safeunlink(p2, 0);
#endif
- Counter.swap.files_cleaned++;
+ statCounter.swap.files_cleaned++;
}
debug(36, 3) ("Cleaned %d unused files from %s\n", k, p1);
return k;
/*
- * $Id: ftp.cc,v 1.295 2000/06/25 22:28:42 wessels Exp $
+ * $Id: ftp.cc,v 1.296 2000/06/27 22:06:01 hno 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++;
+ statCounter.syscalls.sock.reads++;
len = read(fd, ftpState->data.buf + ftpState->data.offset, read_sz);
if (len > 0) {
fd_bytes(fd, len, FD_READ);
#if DELAY_POOLS
delayBytesIn(delay_id, len);
#endif
- kb_incr(&Counter.server.all.kbytes_in, len);
- kb_incr(&Counter.server.ftp.kbytes_in, len);
+ kb_incr(&statCounter.server.all.kbytes_in, len);
+ kb_incr(&statCounter.server.ftp.kbytes_in, len);
ftpState->data.offset += len;
}
debug(9, 5) ("ftpDataRead: FD %d, Read %d bytes\n", fd, len);
const cache_key *key = NULL;
cbdataAdd(ftpState, cbdataXfree, 0);
debug(9, 3) ("ftpStart: '%s'\n", url);
- Counter.server.all.requests++;
- Counter.server.ftp.requests++;
+ statCounter.server.all.requests++;
+ statCounter.server.ftp.requests++;
storeLockObject(entry);
ftpState->entry = entry;
ftpState->request = requestLink(request);
debug(9, 7) ("ftpWriteCommandCallback: wrote %d bytes\n", size);
if (size > 0) {
fd_bytes(fd, size, FD_WRITE);
- kb_incr(&Counter.server.all.kbytes_out, size);
- kb_incr(&Counter.server.ftp.kbytes_out, size);
+ kb_incr(&statCounter.server.all.kbytes_out, size);
+ kb_incr(&statCounter.server.ftp.kbytes_out, size);
}
if (errflag == COMM_ERR_CLOSING)
return;
return;
}
assert(ftpState->ctrl.offset < ftpState->ctrl.size);
- Counter.syscalls.sock.reads++;
+ statCounter.syscalls.sock.reads++;
len = read(fd,
ftpState->ctrl.buf + ftpState->ctrl.offset,
ftpState->ctrl.size - ftpState->ctrl.offset);
if (len > 0) {
fd_bytes(fd, len, FD_READ);
- kb_incr(&Counter.server.all.kbytes_in, len);
- kb_incr(&Counter.server.ftp.kbytes_in, len);
+ kb_incr(&statCounter.server.all.kbytes_in, len);
+ kb_incr(&statCounter.server.ftp.kbytes_in, len);
}
debug(9, 5) ("ftpReadControlReply: FD %d, Read %d bytes\n", fd, len);
if (len < 0) {
/*
- * $Id: globals.h,v 1.94 2000/06/27 08:41:30 hno Exp $
+ * $Id: globals.h,v 1.95 2000/06/27 22:06:01 hno Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern int store_swap_size; /* 0 */
extern unsigned long store_mem_size; /* 0 */
extern time_t hit_only_mode_until; /* 0 */
-extern StatCounters Counter;
+extern StatCounters statCounter;
extern char *err_type_str[];
extern char *icp_opcode_str[];
extern char *swap_log_op_str[];
/*
- * $Id: gopher.cc,v 1.154 2000/06/06 19:34:31 hno Exp $
+ * $Id: gopher.cc,v 1.155 2000/06/27 22:06:02 hno 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++;
+ statCounter.syscalls.sock.reads++;
len = read(fd, buf, read_sz);
if (len > 0) {
fd_bytes(fd, len, FD_READ);
#if DELAY_POOLS
delayBytesIn(delay_id, len);
#endif
- kb_incr(&Counter.server.all.kbytes_in, len);
- kb_incr(&Counter.server.other.kbytes_in, len);
+ kb_incr(&statCounter.server.all.kbytes_in, len);
+ kb_incr(&statCounter.server.other.kbytes_in, len);
}
debug(10, 5) ("gopherReadReply: FD %d read len=%d\n", fd, len);
if (len > 0) {
fd, size, errflag);
if (size > 0) {
fd_bytes(fd, size, FD_WRITE);
- kb_incr(&Counter.server.all.kbytes_out, size);
- kb_incr(&Counter.server.other.kbytes_out, size);
+ kb_incr(&statCounter.server.all.kbytes_out, size);
+ kb_incr(&statCounter.server.other.kbytes_out, size);
}
if (errflag) {
ErrorState *err;
storeLockObject(entry);
gopherState->entry = entry;
debug(10, 3) ("gopherStart: %s\n", storeUrl(entry));
- Counter.server.all.requests++;
- Counter.server.other.requests++;
+ statCounter.server.all.requests++;
+ statCounter.server.other.requests++;
/* Parse url. */
if (gopher_url_parser(storeUrl(entry), gopherState->host, &gopherState->port,
&gopherState->type_id, gopherState->request)) {
/*
- * $Id: helper.cc,v 1.19 2000/06/06 19:34:31 hno Exp $
+ * $Id: helper.cc,v 1.20 2000/06/27 22:06:02 hno Exp $
*
* DEBUG: section 29 Helper process maintenance
* AUTHOR: Harvest Derived?
helper *hlp = srv->parent;
assert(fd == srv->rfd);
assert(cbdataValid(data));
- Counter.syscalls.sock.reads++;
+ statCounter.syscalls.sock.reads++;
len = read(fd, srv->buf + srv->offset, srv->buf_sz - srv->offset);
fd_bytes(fd, len, FD_READ);
debug(29, 5) ("helperHandleRead: %d bytes from %s #%d.\n",
/*
- * $Id: htcp.cc,v 1.30 2000/03/06 16:23:31 wessels Exp $
+ * $Id: htcp.cc,v 1.31 2000/06/27 22:06:02 hno Exp $
*
* DEBUG: section 31 Hypertext Caching Protocol
* AUTHOR: Duane Wesssels
static struct sockaddr_in from;
int flen = sizeof(struct sockaddr_in);
memset(&from, '\0', flen);
- Counter.syscalls.sock.recvfroms++;
+ statCounter.syscalls.sock.recvfroms++;
len = recvfrom(fd, buf, 8192, 0, (struct sockaddr *) &from, &flen);
debug(31, 3) ("htcpRecv: FD %d, %d bytes from %s:%d\n",
fd, len, inet_ntoa(from.sin_addr), ntohs(from.sin_port));
/*
- * $Id: http.cc,v 1.362 2000/05/16 07:09:34 wessels Exp $
+ * $Id: http.cc,v 1.363 2000/06/27 22:06:02 hno 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++;
+ statCounter.syscalls.sock.reads++;
len = read(fd, buf, read_sz);
debug(11, 5) ("httpReadReply: FD %d: len %d.\n", fd, len);
if (len > 0) {
#if DELAY_POOLS
delayBytesIn(delay_id, len);
#endif
- kb_incr(&Counter.server.all.kbytes_in, len);
- kb_incr(&Counter.server.http.kbytes_in, len);
+ kb_incr(&statCounter.server.all.kbytes_in, len);
+ kb_incr(&statCounter.server.http.kbytes_in, len);
commSetTimeout(fd, Config.Timeout.read, NULL, NULL);
IOStats.Http.reads++;
for (clen = len - 1, bin = 0; clen; bin++)
#endif
if (size > 0) {
fd_bytes(fd, size, FD_WRITE);
- kb_incr(&Counter.server.all.kbytes_out, size);
- kb_incr(&Counter.server.http.kbytes_out, size);
+ kb_incr(&statCounter.server.all.kbytes_out, size);
+ kb_incr(&statCounter.server.http.kbytes_out, size);
}
if (errflag == COMM_ERR_CLOSING)
return;
* register the handler to free HTTP state data when the FD closes
*/
comm_add_close_handler(fd, httpStateFree, httpState);
- Counter.server.all.requests++;
- Counter.server.http.requests++;
+ statCounter.server.all.requests++;
+ statCounter.server.http.requests++;
httpSendRequest(httpState);
/*
* We used to set the read timeout here, but not any more.
fd, size, errflag);
if (size > 0) {
fd_bytes(fd, size, FD_WRITE);
- kb_incr(&Counter.server.all.kbytes_out, size);
- kb_incr(&Counter.server.http.kbytes_out, size);
+ kb_incr(&statCounter.server.all.kbytes_out, size);
+ kb_incr(&statCounter.server.http.kbytes_out, size);
}
if (errflag == COMM_ERR_CLOSING)
return;
fd, size, errflag);
if (size > 0) {
fd_bytes(fd, size, FD_WRITE);
- kb_incr(&Counter.server.all.kbytes_out, size);
- kb_incr(&Counter.server.http.kbytes_out, size);
+ kb_incr(&statCounter.server.all.kbytes_out, size);
+ kb_incr(&statCounter.server.http.kbytes_out, size);
}
if (errflag == COMM_ERR_CLOSING)
return;
/*
- * $Id: icmp.cc,v 1.71 2000/05/16 07:06:05 wessels Exp $
+ * $Id: icmp.cc,v 1.72 2000/06/27 22:06:02 hno 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++;
+ statCounter.syscalls.sock.recvfroms++;
n = recv(icmp_sock,
(char *) &preply,
sizeof(pingerReplyData),
/*
- * $Id: icp_v2.cc,v 1.63 2000/05/16 07:06:05 wessels Exp $
+ * $Id: icp_v2.cc,v 1.64 2000/06/27 22:06:02 hno Exp $
*
* DEBUG: section 12 Internet Cache Protocol
* AUTHOR: Duane Wessels
IcpQueueTail = queue;
}
commSetSelect(fd, COMM_SELECT_WRITE, icpUdpSendQueue, NULL, 0);
- Counter.icp.replies_queued++;
+ statCounter.icp.replies_queued++;
} else {
/* don't queue it */
- Counter.icp.replies_dropped++;
+ statCounter.icp.replies_dropped++;
}
return x;
}
while (max--) {
from_len = sizeof(from);
memset(&from, '\0', from_len);
- Counter.syscalls.sock.recvfroms++;
+ statCounter.syscalls.sock.recvfroms++;
len = recvfrom(sock,
buf,
SQUID_UDP_SO_RCVBUF - 1,
if (len < sizeof(*icp))
return;
if (SENT == which) {
- Counter.icp.pkts_sent++;
- kb_incr(&Counter.icp.kbytes_sent, len);
+ statCounter.icp.pkts_sent++;
+ kb_incr(&statCounter.icp.kbytes_sent, len);
if (ICP_QUERY == icp->opcode) {
- Counter.icp.queries_sent++;
- kb_incr(&Counter.icp.q_kbytes_sent, len);
+ statCounter.icp.queries_sent++;
+ kb_incr(&statCounter.icp.q_kbytes_sent, len);
} else {
- Counter.icp.replies_sent++;
- kb_incr(&Counter.icp.r_kbytes_sent, len);
+ statCounter.icp.replies_sent++;
+ kb_incr(&statCounter.icp.r_kbytes_sent, len);
/* this is the sent-reply service time */
- statHistCount(&Counter.icp.reply_svc_time, delay);
+ statHistCount(&statCounter.icp.reply_svc_time, delay);
}
if (ICP_HIT == icp->opcode)
- Counter.icp.hits_sent++;
+ statCounter.icp.hits_sent++;
} else if (RECV == which) {
- Counter.icp.pkts_recv++;
- kb_incr(&Counter.icp.kbytes_recv, len);
+ statCounter.icp.pkts_recv++;
+ kb_incr(&statCounter.icp.kbytes_recv, len);
if (ICP_QUERY == icp->opcode) {
- Counter.icp.queries_recv++;
- kb_incr(&Counter.icp.q_kbytes_recv, len);
+ statCounter.icp.queries_recv++;
+ kb_incr(&statCounter.icp.q_kbytes_recv, len);
} else {
- Counter.icp.replies_recv++;
- kb_incr(&Counter.icp.r_kbytes_recv, len);
- /* Counter.icp.query_svc_time set in clientUpdateCounters */
+ statCounter.icp.replies_recv++;
+ kb_incr(&statCounter.icp.r_kbytes_recv, len);
+ /* statCounter.icp.query_svc_time set in clientUpdateCounters */
}
if (ICP_HIT == icp->opcode)
- Counter.icp.hits_recv++;
+ statCounter.icp.hits_recv++;
}
}
/*
- * $Id: ident.cc,v 1.52 2000/05/16 07:06:05 wessels Exp $
+ * $Id: ident.cc,v 1.53 2000/06/27 22:06:02 hno Exp $
*
* DEBUG: section 30 Ident (RFC 931)
* AUTHOR: Duane Wessels
char *t = NULL;
int len = -1;
buf[0] = '\0';
- Counter.syscalls.sock.reads++;
+ statCounter.syscalls.sock.reads++;
len = read(fd, buf, BUFSIZ - 1);
fd_bytes(fd, len, FD_READ);
if (len <= 0) {
/*
- * $Id: ipcache.cc,v 1.220 2000/05/16 07:06:05 wessels Exp $
+ * $Id: ipcache.cc,v 1.221 2000/06/27 22:06:02 hno Exp $
*
* DEBUG: section 14 IP Cache
* AUTHOR: Harvest Derived
cbdataFree(c);
c = NULL;
n = ++IpcacheStats.replies;
- statHistCount(&Counter.dns.svc_time, tvSubMsec(i->request_time, current_time));
+ statHistCount(&statCounter.dns.svc_time, tvSubMsec(i->request_time, current_time));
#if USE_DNSSERVERS
x = ipcacheParse(reply);
#else
/*
- * $Id: main.cc,v 1.314 2000/05/31 08:57:08 hno Exp $
+ * $Id: main.cc,v 1.315 2000/06/27 22:06:03 hno Exp $
*
* DEBUG: section 1 Startup and Main Loop
* AUTHOR: Harvest Derived
} else if (do_shutdown) {
time_t wait = do_shutdown > 0 ? (int) Config.shutdownLifetime : 0;
debug(1, 1) ("Preparing for shutdown after %d requests\n",
- Counter.client_http.requests);
+ statCounter.client_http.requests);
debug(1, 1) ("Waiting %d seconds for active connections to finish\n",
wait);
do_shutdown = 0;
/*
- * $Id: pconn.cc,v 1.26 2000/03/06 16:23:33 wessels Exp $
+ * $Id: pconn.cc,v 1.27 2000/06/27 22:06:03 hno Exp $
*
* DEBUG: section 48 Persistent Connections
* AUTHOR: Duane Wessels
struct _pconn *p = data;
int n;
assert(table != NULL);
- Counter.syscalls.sock.reads++;
+ statCounter.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: peer_digest.cc,v 1.74 2000/05/07 16:18:19 adrian Exp $
+ * $Id: peer_digest.cc,v 1.75 2000/06/27 22:06:03 hno Exp $
*
* DEBUG: section 72 Peer Digest Routines
* AUTHOR: Alex Rousskov
fetch->old_entry = NULL;
}
/* update global stats */
- kb_incr(&Counter.cd.kbytes_sent, (size_t) fetch->sent.bytes);
- kb_incr(&Counter.cd.kbytes_recv, (size_t) fetch->recv.bytes);
- Counter.cd.msgs_sent += fetch->sent.msg;
- Counter.cd.msgs_recv += fetch->recv.msg;
+ kb_incr(&statCounter.cd.kbytes_sent, (size_t) fetch->sent.bytes);
+ kb_incr(&statCounter.cd.kbytes_recv, (size_t) fetch->recv.bytes);
+ statCounter.cd.msgs_sent += fetch->sent.msg;
+ statCounter.cd.msgs_recv += fetch->recv.msg;
/* unlock everything */
storeUnregister(fetch->sc, fetch->entry, fetch);
host, cblock.mask_size, (int) (cblock.mask_size - freed_size));
pd->cd = cacheDigestCreate(cblock.capacity, cblock.bits_per_entry);
if (cblock.mask_size >= freed_size)
- kb_incr(&Counter.cd.memory, cblock.mask_size - freed_size);
+ kb_incr(&statCounter.cd.memory, cblock.mask_size - freed_size);
}
assert(pd->cd);
/* these assignments leave us in an inconsistent state until we finish reading the digest */
/*
- * $Id: snmp_agent.cc,v 1.76 2000/05/16 07:06:06 wessels Exp $
+ * $Id: snmp_agent.cc,v 1.77 2000/06/27 22:06:03 hno Exp $
*
* DEBUG: section 49 SNMP Interface
* AUTHOR: Kostas Anagnostakis
break;
case PERF_SYS_CURUNLREQ:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.unlink.requests,
+ (snint) statCounter.unlink.requests,
SMI_COUNTER32);
break;
case PERF_SYS_CURUNUSED_FD:
switch (Var->name[LEN_SQ_PRF + 2]) {
case PERF_PROTOSTAT_AGGR_HTTP_REQ:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.client_http.requests,
+ (snint) statCounter.client_http.requests,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_HTTP_HITS:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.client_http.hits,
+ (snint) statCounter.client_http.hits,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_HTTP_ERRORS:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.client_http.errors,
+ (snint) statCounter.client_http.errors,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_HTTP_KBYTES_IN:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.client_http.kbytes_in.kb,
+ (snint) statCounter.client_http.kbytes_in.kb,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_HTTP_KBYTES_OUT:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.client_http.kbytes_out.kb,
+ (snint) statCounter.client_http.kbytes_out.kb,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_ICP_S:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.icp.pkts_sent,
+ (snint) statCounter.icp.pkts_sent,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_ICP_R:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.icp.pkts_recv,
+ (snint) statCounter.icp.pkts_recv,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_ICP_SKB:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.icp.kbytes_sent.kb,
+ (snint) statCounter.icp.kbytes_sent.kb,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_ICP_RKB:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.icp.kbytes_recv.kb,
+ (snint) statCounter.icp.kbytes_recv.kb,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_REQ:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.server.all.requests,
+ (snint) statCounter.server.all.requests,
SMI_INTEGER);
break;
case PERF_PROTOSTAT_AGGR_ERRORS:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.server.all.errors,
+ (snint) statCounter.server.all.errors,
SMI_INTEGER);
break;
case PERF_PROTOSTAT_AGGR_KBYTES_IN:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.server.all.kbytes_in.kb,
+ (snint) statCounter.server.all.kbytes_in.kb,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_KBYTES_OUT:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.server.all.kbytes_out.kb,
+ (snint) statCounter.server.all.kbytes_out.kb,
SMI_COUNTER32);
break;
case PERF_PROTOSTAT_AGGR_CURSWAP:
break;
case PERF_PROTOSTAT_AGGR_CLIENTS:
Answer = snmp_var_new_integer(Var->name, Var->name_length,
- (snint) Counter.client_http.clients,
+ (snint) statCounter.client_http.clients,
SMI_COUNTER32);
break;
default:
/*
- * $Id: snmp_core.cc,v 1.43 2000/05/31 08:57:09 hno Exp $
+ * $Id: snmp_core.cc,v 1.44 2000/06/27 22:06:04 hno Exp $
*
* DEBUG: section 49 SNMP support
* AUTHOR: Glenn Chisholm
memset(&from, '\0', from_len);
memset(buf, '\0', SNMP_REQUEST_SIZE);
- Counter.syscalls.sock.recvfroms++;
+ statCounter.syscalls.sock.recvfroms++;
len = recvfrom(sock,
buf,
/*
- * $Id: ssl.cc,v 1.106 2000/05/30 09:27:18 hno Exp $
+ * $Id: ssl.cc,v 1.107 2000/06/27 22:06:04 hno Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
#if DELAY_POOLS
read_sz = delayBytesWanted(sslState->delay_id, 1, read_sz);
#endif
- Counter.syscalls.sock.reads++;
+ statCounter.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) {
#if DELAY_POOLS
delayBytesIn(sslState->delay_id, len);
#endif
- kb_incr(&Counter.server.all.kbytes_in, len);
- kb_incr(&Counter.server.other.kbytes_in, len);
+ kb_incr(&statCounter.server.all.kbytes_in, len);
+ kb_incr(&statCounter.server.other.kbytes_in, len);
sslState->server.len += len;
}
cbdataLock(sslState);
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++;
+ statCounter.syscalls.sock.reads++;
len = read(fd,
sslState->client.buf + sslState->client.len,
SQUID_TCP_SO_RCVBUF - sslState->client.len);
debug(26, 3) ("sslReadClient: FD %d, read %d bytes\n", fd, len);
if (len > 0) {
fd_bytes(fd, len, FD_READ);
- kb_incr(&Counter.client_http.kbytes_in, len);
+ kb_incr(&statCounter.client_http.kbytes_in, len);
sslState->client.len += len;
}
cbdataLock(sslState);
assert(fd == sslState->server.fd);
debug(26, 3) ("sslWriteServer: FD %d, %d bytes to write\n",
fd, sslState->client.len);
- Counter.syscalls.sock.writes++;
+ statCounter.syscalls.sock.writes++;
len = write(fd,
sslState->client.buf,
sslState->client.len);
debug(26, 3) ("sslWriteServer: FD %d, %d bytes written\n", fd, len);
if (len > 0) {
fd_bytes(fd, len, FD_WRITE);
- kb_incr(&Counter.server.all.kbytes_out, len);
- kb_incr(&Counter.server.other.kbytes_out, len);
+ kb_incr(&statCounter.server.all.kbytes_out, len);
+ kb_incr(&statCounter.server.other.kbytes_out, len);
assert(len <= sslState->client.len);
sslState->client.len -= len;
if (sslState->client.len > 0) {
assert(fd == sslState->client.fd);
debug(26, 3) ("sslWriteClient: FD %d, %d bytes to write\n",
fd, sslState->server.len);
- Counter.syscalls.sock.writes++;
+ statCounter.syscalls.sock.writes++;
len = write(fd,
sslState->server.buf,
sslState->server.len);
debug(26, 3) ("sslWriteClient: FD %d, %d bytes written\n", fd, len);
if (len > 0) {
fd_bytes(fd, len, FD_WRITE);
- kb_incr(&Counter.client_http.kbytes_out, len);
+ kb_incr(&statCounter.client_http.kbytes_out, len);
assert(len <= sslState->server.len);
sslState->server.len -= len;
/* increment total object size */
}
debug(26, 3) ("sslStart: '%s %s'\n",
RequestMethodStr[request->method], url);
- Counter.server.all.requests++;
- Counter.server.other.requests++;
+ statCounter.server.all.requests++;
+ statCounter.server.other.requests++;
/* Create socket. */
sock = comm_open(SOCK_STREAM,
0,
/*
- * $Id: stat.cc,v 1.332 2000/06/26 06:40:02 wessels Exp $
+ * $Id: stat.cc,v 1.333 2000/06/27 22:06:04 hno Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
storeAppendPrintf(sentry, "Connection information for %s:\n",
appname);
storeAppendPrintf(sentry, "\tNumber of clients accessing cache:\t%u\n",
- Counter.client_http.clients);
+ statCounter.client_http.clients);
storeAppendPrintf(sentry, "\tNumber of HTTP requests received:\t%u\n",
- Counter.client_http.requests);
+ statCounter.client_http.requests);
storeAppendPrintf(sentry, "\tNumber of ICP messages received:\t%u\n",
- Counter.icp.pkts_recv);
+ statCounter.icp.pkts_recv);
storeAppendPrintf(sentry, "\tNumber of ICP messages sent:\t%u\n",
- Counter.icp.pkts_sent);
+ statCounter.icp.pkts_sent);
storeAppendPrintf(sentry, "\tNumber of queued ICP replies:\t%u\n",
- Counter.icp.replies_queued);
+ statCounter.icp.replies_queued);
storeAppendPrintf(sentry, "\tRequest failure ratio:\t%5.2f%%\n",
request_failure_ratio);
storeAppendPrintf(sentry, "\tHTTP requests per minute:\t%.1f\n",
- Counter.client_http.requests / (runtime / 60.0));
+ statCounter.client_http.requests / (runtime / 60.0));
storeAppendPrintf(sentry, "\tICP messages per minute:\t%.1f\n",
- (Counter.icp.pkts_sent + Counter.icp.pkts_recv) / (runtime / 60.0));
+ (statCounter.icp.pkts_sent + statCounter.icp.pkts_recv) / (runtime / 60.0));
storeAppendPrintf(sentry, "\tSelect loop called: %d times, %0.3f ms avg\n",
- Counter.select_loops, 1000.0 * runtime / Counter.select_loops);
+ statCounter.select_loops, 1000.0 * runtime / statCounter.select_loops);
storeAppendPrintf(sentry, "Cache information for %s:\n",
appname);
storeAppendPrintf(sentry, "\tMean Object Size:\t%0.2f KB\n",
n_disk_objects ? (double) store_swap_size / n_disk_objects : 0.0);
storeAppendPrintf(sentry, "\tRequests given to unlinkd:\t%d\n",
- Counter.unlink.requests);
+ statCounter.unlink.requests);
storeAppendPrintf(sentry, "Median Service Times (seconds) 5 min 60 min:\n");
storeAppendPrintf(sentry, "\tHTTP Requests (All): %8.5f %8.5f\n",
statCountersInit(&CountHist[i]);
for (i = 0; i < N_COUNT_HOUR_HIST; i++)
statCountersInit(&CountHourHist[i]);
- statCountersInit(&Counter);
+ statCountersInit(&statCounter);
eventAdd("statAvgTick", statAvgTick, NULL, (double) COUNT_INTERVAL, 1);
cachemgrRegister("info",
"General Runtime Information",
{
StatCounters *t = &CountHist[0];
StatCounters *p = &CountHist[1];
- StatCounters *c = &Counter;
+ StatCounters *c = &statCounter;
struct rusage rusage;
eventAdd("statAvgTick", statAvgTick, NULL, (double) COUNT_INTERVAL, 1);
squid_getrusage(&rusage);
static void
statCountersHistograms(StoreEntry * sentry)
{
- StatCounters *f = &Counter;
+ StatCounters *f = &statCounter;
storeAppendPrintf(sentry, "client_http.all_svc_time histogram:\n");
statHistDump(&f->client_http.all_svc_time, sentry, NULL);
storeAppendPrintf(sentry, "client_http.miss_svc_time histogram:\n");
static void
statCountersDump(StoreEntry * sentry)
{
- StatCounters *f = &Counter;
+ StatCounters *f = &statCounter;
struct rusage rusage;
squid_getrusage(&rusage);
f->page_faults = rusage_pagefaults(&rusage);
statPeerSelect(StoreEntry * sentry)
{
#if USE_CACHE_DIGESTS
- StatCounters *f = &Counter;
+ StatCounters *f = &statCounter;
peer *peer;
const int tot_used = f->cd.times_used + f->icp.times_used;
stat5minClientRequests(void)
{
assert(N_COUNT_HIST > 5);
- return Counter.client_http.requests - CountHist[5].client_http.requests;
+ return statCounter.client_http.requests - CountHist[5].client_http.requests;
}
static double
/*
- * $Id: store_client.cc,v 1.94 2000/06/26 22:46:14 wessels Exp $
+ * $Id: store_client.cc,v 1.95 2000/06/27 22:06:04 hno Exp $
*
* DEBUG: section 20 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
storeClose(sc->swapin_sio);
cbdataUnlock(sc->swapin_sio);
sc->swapin_sio = NULL;
- Counter.swap.ins++;
+ statCounter.swap.ins++;
}
if (NULL != sc->callback) {
/* callback with ssize = -1 to indicate unexpected termination */
return;
if (CheckQuickAbort2(entry) == 0)
return;
- Counter.aborted_requests++;
+ statCounter.aborted_requests++;
storeAbort(entry);
}
/*
- * $Id: store_swapin.cc,v 1.25 2000/06/26 03:36:05 wessels Exp $
+ * $Id: store_swapin.cc,v 1.26 2000/06/27 22:06:05 hno Exp $
*
* DEBUG: section 20 Storage Manager Swapin Functions
* AUTHOR: Duane Wessels
sc->callback = NULL;
callback(sc->callback_data, sc->copy_buf, errflag);
}
- Counter.swap.ins++;
+ statCounter.swap.ins++;
}
static void
/*
- * $Id: store_swapout.cc,v 1.72 2000/06/26 03:36:06 wessels Exp $
+ * $Id: store_swapout.cc,v 1.73 2000/06/27 22:06:05 hno Exp $
*
* DEBUG: section 20 Storage Manager Swapout Functions
* AUTHOR: Duane Wessels
storeLog(STORE_LOG_SWAPOUT, e);
storeDirSwapLog(e, SWAP_LOG_ADD);
}
- Counter.swap.outs++;
+ statCounter.swap.outs++;
}
debug(20, 3) ("storeSwapOutFileClosed: %s:%d\n", __FILE__, __LINE__);
mem->swapout.sio = NULL;
/*
- * $Id: tools.cc,v 1.192 2000/05/30 09:30:10 hno Exp $
+ * $Id: tools.cc,v 1.193 2000/06/27 22:06:05 hno Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
void
safeunlink(const char *s, int quiet)
{
- Counter.syscalls.disk.unlinks++;
+ statCounter.syscalls.disk.unlinks++;
if (unlink(s) < 0 && !quiet)
debug(50, 1) ("safeunlink: Couldn't delete %s: %s\n", s, xstrerror());
}
/*
- * $Id: tunnel.cc,v 1.106 2000/05/30 09:27:18 hno Exp $
+ * $Id: tunnel.cc,v 1.107 2000/06/27 22:06:04 hno Exp $
*
* DEBUG: section 26 Secure Sockets Layer Proxy
* AUTHOR: Duane Wessels
#if DELAY_POOLS
read_sz = delayBytesWanted(sslState->delay_id, 1, read_sz);
#endif
- Counter.syscalls.sock.reads++;
+ statCounter.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) {
#if DELAY_POOLS
delayBytesIn(sslState->delay_id, len);
#endif
- kb_incr(&Counter.server.all.kbytes_in, len);
- kb_incr(&Counter.server.other.kbytes_in, len);
+ kb_incr(&statCounter.server.all.kbytes_in, len);
+ kb_incr(&statCounter.server.other.kbytes_in, len);
sslState->server.len += len;
}
cbdataLock(sslState);
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++;
+ statCounter.syscalls.sock.reads++;
len = read(fd,
sslState->client.buf + sslState->client.len,
SQUID_TCP_SO_RCVBUF - sslState->client.len);
debug(26, 3) ("sslReadClient: FD %d, read %d bytes\n", fd, len);
if (len > 0) {
fd_bytes(fd, len, FD_READ);
- kb_incr(&Counter.client_http.kbytes_in, len);
+ kb_incr(&statCounter.client_http.kbytes_in, len);
sslState->client.len += len;
}
cbdataLock(sslState);
assert(fd == sslState->server.fd);
debug(26, 3) ("sslWriteServer: FD %d, %d bytes to write\n",
fd, sslState->client.len);
- Counter.syscalls.sock.writes++;
+ statCounter.syscalls.sock.writes++;
len = write(fd,
sslState->client.buf,
sslState->client.len);
debug(26, 3) ("sslWriteServer: FD %d, %d bytes written\n", fd, len);
if (len > 0) {
fd_bytes(fd, len, FD_WRITE);
- kb_incr(&Counter.server.all.kbytes_out, len);
- kb_incr(&Counter.server.other.kbytes_out, len);
+ kb_incr(&statCounter.server.all.kbytes_out, len);
+ kb_incr(&statCounter.server.other.kbytes_out, len);
assert(len <= sslState->client.len);
sslState->client.len -= len;
if (sslState->client.len > 0) {
assert(fd == sslState->client.fd);
debug(26, 3) ("sslWriteClient: FD %d, %d bytes to write\n",
fd, sslState->server.len);
- Counter.syscalls.sock.writes++;
+ statCounter.syscalls.sock.writes++;
len = write(fd,
sslState->server.buf,
sslState->server.len);
debug(26, 3) ("sslWriteClient: FD %d, %d bytes written\n", fd, len);
if (len > 0) {
fd_bytes(fd, len, FD_WRITE);
- kb_incr(&Counter.client_http.kbytes_out, len);
+ kb_incr(&statCounter.client_http.kbytes_out, len);
assert(len <= sslState->server.len);
sslState->server.len -= len;
/* increment total object size */
}
debug(26, 3) ("sslStart: '%s %s'\n",
RequestMethodStr[request->method], url);
- Counter.server.all.requests++;
- Counter.server.other.requests++;
+ statCounter.server.all.requests++;
+ statCounter.server.other.requests++;
/* Create socket. */
sock = comm_open(SOCK_STREAM,
0,
/*
- * $Id: unlinkd.cc,v 1.40 2000/06/06 19:34:31 hno Exp $
+ * $Id: unlinkd.cc,v 1.41 2000/06/27 22:06:05 hno Exp $
*
* DEBUG: section 12 Unlink Daemon
* AUTHOR: Duane Wessels
safeunlink(path, 0);
return;
}
- Counter.unlink.requests++;
+ statCounter.unlink.requests++;
queuelen++;
}
/*
- * $Id: wais.cc,v 1.132 2000/03/06 16:23:36 wessels Exp $
+ * $Id: wais.cc,v 1.133 2000/06/27 22:06:05 hno 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++;
+ statCounter.syscalls.sock.reads++;
len = read(fd, buf, read_sz);
if (len > 0) {
fd_bytes(fd, len, FD_READ);
#if DELAY_POOLS
delayBytesIn(delay_id, len);
#endif
- kb_incr(&Counter.server.all.kbytes_in, len);
- kb_incr(&Counter.server.other.kbytes_in, len);
+ kb_incr(&statCounter.server.all.kbytes_in, len);
+ kb_incr(&statCounter.server.other.kbytes_in, len);
}
debug(24, 5) ("waisReadReply: FD %d read len:%d\n", fd, len);
if (len > 0) {
fd, size, errflag);
if (size > 0) {
fd_bytes(fd, size, FD_WRITE);
- kb_incr(&Counter.server.all.kbytes_out, size);
- kb_incr(&Counter.server.other.kbytes_out, size);
+ kb_incr(&statCounter.server.all.kbytes_out, size);
+ kb_incr(&statCounter.server.other.kbytes_out, size);
}
if (errflag == COMM_ERR_CLOSING)
return;
const char *url = storeUrl(entry);
method_t method = request->method;
debug(24, 3) ("waisStart: \"%s %s\"\n", RequestMethodStr[method], url);
- Counter.server.all.requests++;
- Counter.server.other.requests++;
+ statCounter.server.all.requests++;
+ statCounter.server.other.requests++;
waisState = xcalloc(1, sizeof(WaisStateData));
cbdataAdd(waisState, cbdataXfree, 0);
waisState->method = method;
/*
- * $Id: wccp.cc,v 1.15 2000/05/16 07:06:08 wessels Exp $
+ * $Id: wccp.cc,v 1.16 2000/06/27 22:06:05 hno Exp $
*
* DEBUG: section 80 WCCP Support
* AUTHOR: Glenn Chisholm
memset(&from, '\0', from_len);
memset(&wccp_i_see_you, '\0', sizeof(wccp_i_see_you));
- Counter.syscalls.sock.recvfroms++;
+ statCounter.syscalls.sock.recvfroms++;
len = recvfrom(sock,
(void *) &wccp_i_see_you,
/*
- * $Id: whois.cc,v 1.11 2000/05/16 07:06:08 wessels Exp $
+ * $Id: whois.cc,v 1.12 2000/06/27 22:06:06 hno Exp $
*
* DEBUG: section 75 WHOIS protocol
* AUTHOR: Duane Wessels, Kostas Anagnostakis
char *buf = memAllocate(MEM_4K_BUF);
MemObject *mem = entry->mem_obj;
int len;
- Counter.syscalls.sock.reads++;
+ statCounter.syscalls.sock.reads++;
len = read(fd, buf, 4095);
buf[len] = '\0';
debug(75, 3) ("whoisReadReply: FD %d read %d bytes\n", fd, len);
if (0 == mem->inmem_hi)
mem->reply->sline.status = HTTP_OK;
fd_bytes(fd, len, FD_READ);
- kb_incr(&Counter.server.all.kbytes_in, len);
- kb_incr(&Counter.server.http.kbytes_in, len);
+ kb_incr(&statCounter.server.all.kbytes_in, len);
+ kb_incr(&statCounter.server.http.kbytes_in, len);
storeAppend(entry, buf, len);
commSetSelect(fd, COMM_SELECT_READ, whoisReadReply, p, Config.Timeout.read);
} else if (len < 0) {