]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Renamed Counter to statCounter to avoid a name space collision on Solaris 8
authorhno <>
Wed, 28 Jun 2000 04:05:58 +0000 (04:05 +0000)
committerhno <>
Wed, 28 Jun 2000 04:05:58 +0000 (04:05 +0000)
38 files changed:
src/CacheDigest.cc
src/client_db.cc
src/client_side.cc
src/comm.cc
src/comm_select.cc
src/disk.cc
src/dns_internal.cc
src/fqdncache.cc
src/fs/aufs/store_dir_aufs.cc
src/fs/diskd/store_dir_diskd.cc
src/fs/diskd/store_io_diskd.cc
src/fs/ufs/store_dir_ufs.cc
src/ftp.cc
src/globals.h
src/gopher.cc
src/helper.cc
src/htcp.cc
src/http.cc
src/icmp.cc
src/icp_v2.cc
src/ident.cc
src/ipcache.cc
src/main.cc
src/pconn.cc
src/peer_digest.cc
src/snmp_agent.cc
src/snmp_core.cc
src/ssl.cc
src/stat.cc
src/store_client.cc
src/store_swapin.cc
src/store_swapout.cc
src/tools.cc
src/tunnel.cc
src/unlinkd.cc
src/wais.cc
src/wccp.cc
src/whois.cc

index 780f531ee7b0e6187572e90159e5f8a7620bc15f..a088da41742dbab613c915f7698eaa60fda3aef4 100644 (file)
@@ -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++;
index bc8a3f29221de1b207f0ad741661f3b83f6f02f0..770c83458f937adc333a81c2d4c300be50d05316 100644 (file)
@@ -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;
 }
 
index ed7ce5051f59a3df383ff7d96d06f6eb209dbf2f..14cb360b8a68b9d0b319a8210feef701cb090b03 100644 (file)
@@ -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
index 1168e198143352ef815e6b4c0adbba89ac6ca784..6facc49de9582fe1fe5160dd5826177674b3dd9d 100644 (file)
@@ -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 */
index ade76212b0688796aa3f4842e254cf1a7f203149..b197d846afb989a748111c5221d2aa02e0319531 100644 (file)
@@ -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",
index 109e8768afe3889b492d2e2f03e854551ce157a3..a507ce14c1c7b046570ae33d0df8cc42e4501b6e 100644 (file)
@@ -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)) {
index db77d2e30bab4c969f2d4037804c72fd7da6a2a0..3a1f25e513c1098e8d664de6a2ba1e15973a315e 100644 (file)
@@ -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;
index 8eb41cbc6549e65fc646c6b12434f255fdb4f120..b8acde8ecac8ba7f24675a7854e8e02202a2e2d6 100644 (file)
@@ -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);
index 465cce6d0771a51831ca69712ff1bdf203eafdb5..ad1da3c76e4cb966e60a354100a6e0702ca8671d 100644 (file)
@@ -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;
index c70b3bb848290b7412adc0d62eb9efb450b02bed..19a980b313c490d7bcb5a38d2f15f96156393db1 100644 (file)
@@ -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;
index bf6dfe807073a6c2fe01691cd37db0c808103da6..5153ef83e176de300c2f4919481507b236720b38 100644 (file)
@@ -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
index afa340419c334d1584d0fe2d592fc082b35e3f7f..385c6ad6071d8c59b15da3d78c9c8a54e48edb56 100644 (file)
@@ -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;
index 494018c18aa5059e78f9d4434e95a78d76fbaaa0..e5c69f3cc97ee542f7a644aa406ea2141c5a1e2c 100644 (file)
@@ -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) {
index 2e9c27b2677328d40fbadc978392081f5af79bc4..191cdc704320b58e125135a3fb575d3fac6d1449 100644 (file)
@@ -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[];
index 8dda8184c926b98e7a4fcbe104cf47baf558650d..1c7f03a78e0094809cbbf1a8f2249f6bc81b3de9 100644 (file)
@@ -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)) {
index 7d9a44f3b6d0427c8fd3c399010281b5a781ca9a..fa7f44e4f3f3926f03daa72bc54d61c2468e8fa7 100644 (file)
@@ -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",
index b54bb8f243a133d004d504414ec645ed43b9fbf9..53bac0ca144a4a91b87b6d80e0f975df86baf4ce 100644 (file)
@@ -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));
index ac514c1c9b923207dba3003aa788c5007163d5a0..64b195cb56c115d051674ae6e7e139caf0026070 100644 (file)
@@ -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;
index 8cd8097ca7b43286e5ca25e04194c4015a048db4..558e8cf0b3577a3968fea9e17915f0956f6f9bde 100644 (file)
@@ -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),
index 45023da234d47824b53c9e266adccaedde10ac5c..b63eacaf42e72027527387123768361a1d1f8270 100644 (file)
@@ -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++;
     }
 }
 
index 4a7fb1369e270b4b2d063a6a30313f32396b9b30..8ea27697353513aab479af7d90de979d5b65aa0c 100644 (file)
@@ -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) {
index adf7b6c6b2877a8cc461b40daf86d7ad2e03ad72..8a572d05576c655400f18be0541de3048f1c2c04 100644 (file)
@@ -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
index bc4e2ff897b07f74a55c6613ec9e4db6bd3bce26..e573f9a6d338742769db4f679debf34681d46ab7 100644 (file)
@@ -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;
index c2226323a5bcb512ae0957e74eeb2ede2218d5bb..55505f4de72000f150d01d8b2bf391d1327f0eb0 100644 (file)
@@ -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);
index ad0c422b9a5045c10043c5249e52c56084f2310a..342e594520359bdf2dd39226c72e9d88383f2af4 100644 (file)
@@ -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 */
index 7994332ccef0ed29e455f68a7b09a833f949d071..f4638e71cc444967e46954d5c43e46b40aac6f2e 100644 (file)
@@ -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:
index 4c0fae87814972f135fc77c34def6f3f644fa411..efc02e6a25629e7a0158cc722a4fac794a957c1b 100644 (file)
@@ -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,
index eabfb7265a0827044d9f1f86515496f3d85f018f..b67d853ae719a5fbfcd40f0346f3135744e81e27 100644 (file)
@@ -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,
index 1bfe840e549daea3344062d003295d05a5ef5f24..629523c84beba7d0b4df48ac46e78c10b48e0410 100644 (file)
@@ -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
index e715c2306b57b6a25f1ce8189dafb97600d261f0..bb3e7d3effd37b6ad280f2e033a676dc2ec258c1 100644 (file)
@@ -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);
 }
index 1e7f6c30046244115ae4f4ef78464e6bc140a033..717bc0eb01445b2db9587c4f7ff856e7d86e2128 100644 (file)
@@ -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
index 697f00b7beda822ff6a52d050961d4a856cd9690..ae508c25eb5e706addb4d2d285649844cb11cd45 100644 (file)
@@ -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;
index 855c898ba8ca212d02ad0e6ca720776d8ee01847..5957332a4866acc4582fc1d8fff0d5847c45a898 100644 (file)
@@ -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());
 }
index 55ccc6ffa371d05e356b28ecb58c05b4563828a5..c628988dde2c47058ecdb0119de23c40d57f14fe 100644 (file)
@@ -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,
index 7d882ef62bef12c900a2bdde62876de5bb1b7d62..d3812960a3b5d541c8cda8bed85c45db9ce7df85 100644 (file)
@@ -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++;
 }
 
index ddf82afde1a94e1786c8b48525c0018fe31b58d7..b58afda41f12685fc2ca07edfa9cf7d287357de2 100644 (file)
@@ -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;
index 4ffb417b0209cc1a2297da0d2fe36bff34ba7499..46d01d11bb541df918a292c3f045ecc6b44b27e1 100644 (file)
@@ -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,
index 6491de232fe9e135c95a9ceafb97072e1c498140..08517a688fc7598b548d3506159e73d013914074 100644 (file)
@@ -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) {