From 83704487878b743ec12cf390280ad1d000d671cc Mon Sep 17 00:00:00 2001 From: hno <> Date: Wed, 28 Jun 2000 04:05:58 +0000 Subject: [PATCH] Renamed Counter to statCounter to avoid a name space collision on Solaris 8 --- src/CacheDigest.cc | 4 +-- src/client_db.cc | 4 +-- src/client_side.cc | 40 ++++++++++++++-------------- src/comm.cc | 20 +++++++------- src/comm_select.cc | 46 ++++++++++++++++----------------- src/disk.cc | 12 ++++----- src/dns_internal.cc | 4 +-- src/fqdncache.cc | 4 +-- src/fs/aufs/store_dir_aufs.cc | 6 ++--- src/fs/diskd/store_dir_diskd.cc | 6 ++--- src/fs/diskd/store_io_diskd.cc | 12 ++++----- src/fs/ufs/store_dir_ufs.cc | 6 ++--- src/ftp.cc | 22 ++++++++-------- src/globals.h | 4 +-- src/gopher.cc | 16 ++++++------ src/helper.cc | 4 +-- src/htcp.cc | 4 +-- src/http.cc | 24 ++++++++--------- src/icmp.cc | 4 +-- src/icp_v2.cc | 40 ++++++++++++++-------------- src/ident.cc | 4 +-- src/ipcache.cc | 4 +-- src/main.cc | 4 +-- src/pconn.cc | 4 +-- src/peer_digest.cc | 12 ++++----- src/snmp_agent.cc | 32 +++++++++++------------ src/snmp_core.cc | 4 +-- src/ssl.cc | 26 +++++++++---------- src/stat.cc | 32 +++++++++++------------ src/store_client.cc | 6 ++--- src/store_swapin.cc | 4 +-- src/store_swapout.cc | 4 +-- src/tools.cc | 4 +-- src/tunnel.cc | 26 +++++++++---------- src/unlinkd.cc | 4 +-- src/wais.cc | 16 ++++++------ src/wccp.cc | 4 +-- src/whois.cc | 8 +++--- 38 files changed, 240 insertions(+), 240 deletions(-) diff --git a/src/CacheDigest.cc b/src/CacheDigest.cc index 780f531ee7..a088da4174 100644 --- a/src/CacheDigest.cc +++ b/src/CacheDigest.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -167,7 +167,7 @@ cacheDigestAdd(CacheDigest * cd, const cache_key * key) 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++; diff --git a/src/client_db.cc b/src/client_db.cc index bc8a3f2922..770c83458f 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -47,7 +47,7 @@ clientdbAdd(struct in_addr addr) 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; } diff --git a/src/client_side.cc b/src/client_side.cc index ed7ce5051f..14cb360b8a 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -617,16 +617,16 @@ clientUpdateCounters(clientHttpRequest * http) 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 @@ -635,19 +635,19 @@ clientUpdateCounters(clientHttpRequest * http) */ 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 */ @@ -656,19 +656,19 @@ clientUpdateCounters(clientHttpRequest * http) 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; @@ -1852,9 +1852,9 @@ clientWriteComplete(int fd, char *bufnotused, size_t size, int errflag, void *da 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) { /* @@ -2392,11 +2392,11 @@ clientReadRequest(int fd, void *data) 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 diff --git a/src/comm.cc b/src/comm.cc index 1168e19814..6facc49de9 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -126,7 +126,7 @@ commBind(int s, struct in_addr in_addr, u_short port) 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", @@ -151,7 +151,7 @@ comm_open(int sock_type, 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 @@ -297,9 +297,9 @@ commResetFD(ConnectStateData * cs) 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) @@ -420,7 +420,7 @@ comm_connect_addr(int sock, const struct sockaddr_in *address) 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()); @@ -479,7 +479,7 @@ comm_accept(int fd, struct sockaddr_in *pn, struct sockaddr_in *me) 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()); @@ -582,7 +582,7 @@ comm_close(int fd) 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. */ @@ -594,7 +594,7 @@ comm_udp_sendto(int fd, 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_ @@ -789,7 +789,7 @@ commHandleWrite(int fd, void *data) 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 */ diff --git a/src/comm_select.cc b/src/comm_select.cc index ade76212b0..b197d846af 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -1,6 +1,6 @@ /* - * $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 * @@ -223,7 +223,7 @@ comm_check_incoming_poll_handlers(int nfds, int *fds) #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++) { @@ -272,7 +272,7 @@ comm_poll_icp_incoming(void) 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 @@ -299,7 +299,7 @@ comm_poll_http_incoming(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. */ @@ -377,9 +377,9 @@ comm_poll(int msec) 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)) @@ -390,7 +390,7 @@ comm_poll(int msec) /* 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; @@ -430,7 +430,7 @@ comm_poll(int msec) else { F->read_handler = NULL; hdl(fd, F->read_data); - Counter.select_fds++; + statCounter.select_fds++; if (commCheckICPIncoming) comm_poll_icp_incoming(); if (commCheckDNSIncoming) @@ -444,7 +444,7 @@ comm_poll(int msec) 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) @@ -491,7 +491,7 @@ comm_poll(int msec) 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) @@ -503,7 +503,7 @@ comm_poll(int msec) #endif #if !ALARM_UPDATES_TIME getCurrentTime(); - Counter.select_time += (current_dtime - start); + statCounter.select_time += (current_dtime - start); #endif return COMM_OK; } @@ -544,7 +544,7 @@ comm_check_incoming_select_handlers(int nfds, int *fds) #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++) { @@ -595,7 +595,7 @@ comm_select_icp_incoming(void) 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 @@ -621,7 +621,7 @@ comm_select_http_incoming(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 @@ -729,9 +729,9 @@ comm_select(int msec) 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)) @@ -746,7 +746,7 @@ comm_select(int msec) 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) { @@ -797,7 +797,7 @@ comm_select(int msec) 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) @@ -841,7 +841,7 @@ comm_select(int msec) 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) @@ -865,7 +865,7 @@ comm_select(int msec) 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) @@ -911,7 +911,7 @@ comm_select_dns_incoming(void) 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 @@ -959,7 +959,7 @@ examine_select(fd_set * readfds, fd_set * writefds) 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); @@ -1025,7 +1025,7 @@ checkTimeouts(void) 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", diff --git a/src/disk.cc b/src/disk.cc index 109e8768af..a507ce14c1 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -65,7 +65,7 @@ file_open(const char *path, int mode) 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()); @@ -118,7 +118,7 @@ file_close(int fd) 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++; } /* @@ -193,7 +193,7 @@ diskHandleWrite(int fd, void *notused) 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)) { @@ -348,14 +348,14 @@ diskHandleRead(int fd, void *data) 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)) { diff --git a/src/dns_internal.cc b/src/dns_internal.cc index db77d2e30b..3a1f25e513 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -306,7 +306,7 @@ idnsRead(int fd, void *data) 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; diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 8eb41cbc65..b8acde8eca 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -333,7 +333,7 @@ fqdncacheHandleReply(void *data, rfc1035_rr * answers, int na) 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); diff --git a/src/fs/aufs/store_dir_aufs.cc b/src/fs/aufs/store_dir_aufs.cc index 465cce6d07..ad1da3c76e 100644 --- a/src/fs/aufs/store_dir_aufs.cc +++ b/src/fs/aufs/store_dir_aufs.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -409,7 +409,7 @@ storeAufsDirRebuildFromDirectory(void *data) 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()); @@ -1177,7 +1177,7 @@ storeAufsDirClean(int swap_index) #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; diff --git a/src/fs/diskd/store_dir_diskd.cc b/src/fs/diskd/store_dir_diskd.cc index c70b3bb848..19a980b313 100644 --- a/src/fs/diskd/store_dir_diskd.cc +++ b/src/fs/diskd/store_dir_diskd.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -560,7 +560,7 @@ storeDiskdDirRebuildFromDirectory(void *data) 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()); @@ -1353,7 +1353,7 @@ storeDiskdDirClean(int swap_index) #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; diff --git a/src/fs/diskd/store_io_diskd.cc b/src/fs/diskd/store_io_diskd.cc index bf6dfe8070..5153ef83e1 100644 --- a/src/fs/diskd/store_io_diskd.cc +++ b/src/fs/diskd/store_io_diskd.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -297,7 +297,7 @@ static void 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) { @@ -309,7 +309,7 @@ static void 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) { @@ -332,7 +332,7 @@ storeDiskdReadDone(diomsg * M) 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); @@ -359,7 +359,7 @@ storeDiskdWriteDone(diomsg * M) { 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); @@ -375,7 +375,7 @@ storeDiskdUnlinkDone(diomsg * M) { debug(81, 3) ("storeDiskdUnlinkDone: fileno %08x status %d\n", M->id, M->status); - Counter.syscalls.disk.unlinks++; + statCounter.syscalls.disk.unlinks++; } void diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index afa340419c..385c6ad607 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -409,7 +409,7 @@ storeUfsDirRebuildFromDirectory(void *data) 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()); @@ -1177,7 +1177,7 @@ storeUfsDirClean(int swap_index) #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; diff --git a/src/ftp.cc b/src/ftp.cc index 494018c18a..e5c69f3cc9 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -873,15 +873,15 @@ ftpDataRead(int fd, void *data) 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); @@ -1042,8 +1042,8 @@ ftpStart(FwdState * fwd) 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); @@ -1126,8 +1126,8 @@ ftpWriteCommandCallback(int fd, char *bufnotused, size_t size, int errflag, void 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; @@ -1240,14 +1240,14 @@ ftpReadControlReply(int fd, void *data) 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) { diff --git a/src/globals.h b/src/globals.h index 2e9c27b267..191cdc7043 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1,6 +1,6 @@ /* - * $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/ @@ -116,7 +116,7 @@ extern int store_dirs_rebuilding; /* 1 */ 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[]; diff --git a/src/gopher.cc b/src/gopher.cc index 8dda8184c9..1c7f03a78e 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -610,15 +610,15 @@ gopherReadReply(int fd, void *data) 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) { @@ -684,8 +684,8 @@ gopherSendComplete(int fd, char *buf, size_t size, int errflag, void *data) 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; @@ -773,8 +773,8 @@ gopherStart(FwdState * fwdState) 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)) { diff --git a/src/helper.cc b/src/helper.cc index 7d9a44f3b6..fa7f44e4f3 100644 --- a/src/helper.cc +++ b/src/helper.cc @@ -1,6 +1,6 @@ /* - * $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? @@ -286,7 +286,7 @@ helperHandleRead(int fd, void *data) 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", diff --git a/src/htcp.cc b/src/htcp.cc index b54bb8f243..53bac0ca14 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -821,7 +821,7 @@ htcpRecv(int fd, void *data) 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)); diff --git a/src/http.cc b/src/http.cc index ac514c1c9b..64b195cb56 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -480,7 +480,7 @@ httpReadReply(int fd, void *data) #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) { @@ -488,8 +488,8 @@ httpReadReply(int fd, void *data) #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++) @@ -597,8 +597,8 @@ httpSendComplete(int fd, char *bufnotused, size_t size, int errflag, void *data) #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; @@ -929,8 +929,8 @@ httpStart(FwdState * fwd) * 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. @@ -949,8 +949,8 @@ httpSendRequestEntry(int fd, char *bufnotused, size_t size, int errflag, void *d 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; @@ -980,8 +980,8 @@ httpSendRequestEntryDone(int fd, char *bufnotused, size_t size, int errflag, voi 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; diff --git a/src/icmp.cc b/src/icmp.cc index 8cd8097ca7..558e8cf0b3 100644 --- a/src/icmp.cc +++ b/src/icmp.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -73,7 +73,7 @@ icmpRecv(int unused1, void *unused2) 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), diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 45023da234..b63eacaf42 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -156,10 +156,10 @@ icpUdpSend(int fd, 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; } @@ -348,7 +348,7 @@ icpHandleUdp(int sock, void *data) 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, @@ -514,32 +514,32 @@ icpCount(void *buf, int which, size_t len, int delay) 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++; } } diff --git a/src/ident.cc b/src/ident.cc index 4a7fb1369e..8ea2769735 100644 --- a/src/ident.cc +++ b/src/ident.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -139,7 +139,7 @@ identReadReply(int fd, void *data) 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) { diff --git a/src/ipcache.cc b/src/ipcache.cc index adf7b6c6b2..8a572d0557 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -406,7 +406,7 @@ ipcacheHandleReply(void *data, rfc1035_rr * answers, int na) 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 diff --git a/src/main.cc b/src/main.cc index bc4e2ff897..e573f9a6d3 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -693,7 +693,7 @@ main(int argc, char **argv) } 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; diff --git a/src/pconn.cc b/src/pconn.cc index c2226323a5..55505f4de7 100644 --- a/src/pconn.cc +++ b/src/pconn.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -119,7 +119,7 @@ pconnRead(int fd, void *data) 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); diff --git a/src/peer_digest.cc b/src/peer_digest.cc index ad0c422b9a..342e594520 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -690,10 +690,10 @@ peerDigestFetchFinish(DigestFetchState * fetch, int err) 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); @@ -799,7 +799,7 @@ peerDigestSetCBlock(PeerDigest * pd, const char *buf) 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 */ diff --git a/src/snmp_agent.cc b/src/snmp_agent.cc index 7994332cce..f4638e71cc 100644 --- a/src/snmp_agent.cc +++ b/src/snmp_agent.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -286,7 +286,7 @@ snmp_prfSysFn(variable_list * Var, snint * ErrP) 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: @@ -326,67 +326,67 @@ snmp_prfProtoFn(variable_list * Var, snint * ErrP) 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: @@ -396,7 +396,7 @@ snmp_prfProtoFn(variable_list * Var, snint * ErrP) 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: diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 4c0fae8781..efc02e6a25 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -460,7 +460,7 @@ snmpHandleUdp(int sock, void *not_used) memset(&from, '\0', from_len); memset(buf, '\0', SNMP_REQUEST_SIZE); - Counter.syscalls.sock.recvfroms++; + statCounter.syscalls.sock.recvfroms++; len = recvfrom(sock, buf, diff --git a/src/ssl.cc b/src/ssl.cc index eabfb7265a..b67d853ae7 100644 --- a/src/ssl.cc +++ b/src/ssl.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -198,7 +198,7 @@ sslReadServer(int fd, void *data) #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) { @@ -206,8 +206,8 @@ sslReadServer(int fd, void *data) #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); @@ -234,14 +234,14 @@ sslReadClient(int fd, void *data) 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); @@ -274,15 +274,15 @@ sslWriteServer(int fd, void *data) 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) { @@ -313,14 +313,14 @@ sslWriteClient(int fd, void *data) 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 */ @@ -459,8 +459,8 @@ sslStart(int fd, const char *url, request_t * request, size_t * size_ptr) } 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, diff --git a/src/stat.cc b/src/stat.cc index 1bfe840e54..629523c84b 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -460,24 +460,24 @@ info_get(StoreEntry * sentry) 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); @@ -500,7 +500,7 @@ info_get(StoreEntry * sentry) 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", @@ -824,7 +824,7 @@ statInit(void) 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", @@ -884,7 +884,7 @@ statAvgTick(void *notused) { 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); @@ -1022,7 +1022,7 @@ statCountersCopy(StatCounters * dest, const StatCounters * orig) 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"); @@ -1044,7 +1044,7 @@ statCountersHistograms(StoreEntry * sentry) static void statCountersDump(StoreEntry * sentry) { - StatCounters *f = &Counter; + StatCounters *f = &statCounter; struct rusage rusage; squid_getrusage(&rusage); f->page_faults = rusage_pagefaults(&rusage); @@ -1185,7 +1185,7 @@ static void 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; @@ -1301,7 +1301,7 @@ int 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 diff --git a/src/store_client.cc b/src/store_client.cc index e715c2306b..bb3e7d3eff 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -515,7 +515,7 @@ storeUnregister(store_client * sc, StoreEntry * e, void *data) 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 */ @@ -657,6 +657,6 @@ CheckQuickAbort(StoreEntry * entry) return; if (CheckQuickAbort2(entry) == 0) return; - Counter.aborted_requests++; + statCounter.aborted_requests++; storeAbort(entry); } diff --git a/src/store_swapin.cc b/src/store_swapin.cc index 1e7f6c3004..717bc0eb01 100644 --- a/src/store_swapin.cc +++ b/src/store_swapin.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -80,7 +80,7 @@ storeSwapInFileClosed(void *data, int errflag, storeIOState * sio) sc->callback = NULL; callback(sc->callback_data, sc->copy_buf, errflag); } - Counter.swap.ins++; + statCounter.swap.ins++; } static void diff --git a/src/store_swapout.cc b/src/store_swapout.cc index 697f00b7be..ae508c25eb 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -303,7 +303,7 @@ storeSwapOutFileClosed(void *data, int errflag, storeIOState * sio) 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; diff --git a/src/tools.cc b/src/tools.cc index 855c898ba8..5957332a48 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -476,7 +476,7 @@ uniqueHostname(void) 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()); } diff --git a/src/tunnel.cc b/src/tunnel.cc index 55ccc6ffa3..c628988dde 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -198,7 +198,7 @@ sslReadServer(int fd, void *data) #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) { @@ -206,8 +206,8 @@ sslReadServer(int fd, void *data) #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); @@ -234,14 +234,14 @@ sslReadClient(int fd, void *data) 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); @@ -274,15 +274,15 @@ sslWriteServer(int fd, void *data) 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) { @@ -313,14 +313,14 @@ sslWriteClient(int fd, void *data) 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 */ @@ -459,8 +459,8 @@ sslStart(int fd, const char *url, request_t * request, size_t * size_ptr) } 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, diff --git a/src/unlinkd.cc b/src/unlinkd.cc index 7d882ef62b..d3812960a3 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -139,7 +139,7 @@ unlinkdUnlink(const char *path) safeunlink(path, 0); return; } - Counter.unlink.requests++; + statCounter.unlink.requests++; queuelen++; } diff --git a/src/wais.cc b/src/wais.cc index ddf82afde1..b58afda41f 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -102,15 +102,15 @@ waisReadReply(int fd, void *data) #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) { @@ -170,8 +170,8 @@ waisSendComplete(int fd, char *bufnotused, size_t size, int errflag, void *data) 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; @@ -226,8 +226,8 @@ waisStart(FwdState * fwd) 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; diff --git a/src/wccp.cc b/src/wccp.cc index 4ffb417b02..46d01d11bb 100644 --- a/src/wccp.cc +++ b/src/wccp.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -219,7 +219,7 @@ wccpHandleUdp(int sock, void *not_used) 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, diff --git a/src/whois.cc b/src/whois.cc index 6491de232f..08517a688f 100644 --- a/src/whois.cc +++ b/src/whois.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -88,7 +88,7 @@ whoisReadReply(int fd, void *data) 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); @@ -97,8 +97,8 @@ whoisReadReply(int fd, void *data) 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) { -- 2.47.3