#include "squid.h"
#include "base/StringArea.h"
#include "HttpHeader.h"
++#include "HttpHeaderStat.h"
#include "HttpHdrCc.h"
#include "StatHist.h"
#include "Store.h"
#include "squid.h"
#include "Store.h"
#include "HttpHeader.h"
++#include "HttpHeaderStat.h"
#include "HttpHdrSc.h"
#if HAVE_MAP
#include "HttpHdrCc.h"
#include "HttpHdrSc.h"
#include "HttpHeader.h"
++#include "HttpHeaderStat.h"
#include "MemBuf.h"
#include "mgr/Registration.h"
#include "rfc1123.h"
--- /dev/null
--- /dev/null
++/*
++ * HttpHeaderStat.h
++ *
++ * Created on: Dec 9, 2011
++ * Author: kinkie
++ */
++
++#ifndef HTTPHEADERSTAT_H_
++#define HTTPHEADERSTAT_H_
++
++/* per header statistics */
++
++#include "StatHist.h"
++class HttpHeaderStat {
++public:
++ const char *label;
++ HttpHeaderMask *owner_mask;
++
++ StatHist hdrUCountDistr;
++ StatHist fieldTypeDistr;
++ StatHist ccTypeDistr;
++ StatHist scTypeDistr;
++
++ int parsedCount;
++ int ccParsedCount;
++ int scParsedCount;
++ int destroyedCount;
++ int busyDestroyedCount;
++};
++
++
++#endif /* HTTPHEADERSTAT_H_ */
HttpHdrScTarget.h \
HttpHdrContRange.cc \
HttpHdrContRange.h \
++ HttpHeaderStat.h \
HttpHeader.cc \
HttpHeader.h \
HttpHeaderMask.h \
SquidMath.cc \
SquidNew.cc \
stat.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
String.cc \
tests/stub_cache_manager.cc \
tests/stub_debug.cc \
tests/stub_HelperChildConfig.cc \
++ StatCounters.h \
StatHist.h \
tests/stub_StatHist.cc \
tests/stub_store.cc \
Packer.cc \
Parsing.cc \
SquidMath.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
SquidMath.h \
SquidMath.cc \
stat.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
Parsing.cc \
refresh.cc \
RemovalPolicy.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
SquidMath.cc \
SquidMath.h \
stat.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
SquidMath.h \
SquidMath.cc \
stat.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
SquidMath.h \
SquidMath.cc \
stat.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
SquidMath.h \
SquidMath.cc \
stat.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
Parsing.cc \
RemovalPolicy.cc \
refresh.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
HttpHdrSc.cc \
HttpHdrScTarget.cc \
url.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
HttpHdrRange.cc \
Packer.cc \
Parsing.cc \
RemovalPolicy.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
HttpHdrSc.cc \
HttpHdrScTarget.cc \
url.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
HttpHdrRange.cc \
HttpHdrSc.cc \
HttpHdrScTarget.cc \
url.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
HttpHdrRange.cc \
SquidMath.h \
SquidMath.cc \
stat.cc \
++ StatCounters.h \
StatHist.h \
StatHist.cc \
stmem.cc \
--- /dev/null
--- /dev/null
++/*
++ * StatCounters.h
++ *
++ * Created on: Dec 9, 2011
++ * Author: kinkie
++ */
++
++#ifndef STATCOUNTERS_H_
++#define STATCOUNTERS_H_
++
++#include "config.h"
++
++#include "StatHist.h"
++
++#if USE_CACHE_DIGESTS
++/* statistics for cache digests and other hit "predictors" */
++class cd_guess_stats {
++public:
++ /* public, read-only */
++ int true_hits;
++ int false_hits;
++ int true_misses;
++ int false_misses;
++ int close_hits; /* tmp, remove it later */
++};
++#endif
++
++
++/*
++ * if you add a field to StatCounters,
++ * you MUST sync statCountersInitSpecial, statCountersClean, and statCountersCopy
++ */
++class StatCounters {
++public:
++
++ struct {
++ int clients;
++ int requests;
++ int hits;
++ int mem_hits;
++ int disk_hits;
++ int errors;
++ kb_t kbytes_in;
++ kb_t kbytes_out;
++ kb_t hit_kbytes_out;
++ StatHist miss_svc_time;
++ StatHist nm_svc_time;
++ StatHist nh_svc_time;
++ StatHist hit_svc_time;
++ StatHist all_svc_time;
++ } client_http;
++
++ struct {
++
++ struct {
++ int requests;
++ int errors;
++ kb_t kbytes_in;
++ kb_t kbytes_out;
++ } all , http, ftp, other;
++ } server;
++
++ struct {
++ int pkts_sent;
++ int queries_sent;
++ int replies_sent;
++ int pkts_recv;
++ int queries_recv;
++ int replies_recv;
++ int hits_sent;
++ int hits_recv;
++ int replies_queued;
++ int replies_dropped;
++ kb_t kbytes_sent;
++ kb_t q_kbytes_sent;
++ kb_t r_kbytes_sent;
++ kb_t kbytes_recv;
++ kb_t q_kbytes_recv;
++ kb_t r_kbytes_recv;
++ StatHist query_svc_time;
++ StatHist reply_svc_time;
++ int query_timeouts;
++ int times_used;
++ } icp;
++
++ struct {
++ int pkts_sent;
++ int pkts_recv;
++ } htcp;
++
++ struct {
++ int requests;
++ } unlink;
++
++ struct {
++ StatHist svc_time;
++ } dns;
++
++ struct {
++ int times_used;
++ kb_t kbytes_sent;
++ kb_t kbytes_recv;
++ kb_t memory;
++ int msgs_sent;
++ int msgs_recv;
++#if USE_CACHE_DIGESTS
++
++ cd_guess_stats guess;
++#endif
++
++ StatHist on_xition_count;
++ } cd;
++
++ struct {
++ int times_used;
++ } netdb;
++ int page_faults;
++ unsigned long int select_loops;
++ int select_fds;
++ double select_time;
++ double cputime;
++
++ struct timeval timestamp;
++ StatHist comm_icp_incoming;
++ StatHist comm_dns_incoming;
++ StatHist comm_http_incoming;
++ StatHist select_fds_hist;
++
++ struct {
++ struct {
++ int opens;
++ int closes;
++ int reads;
++ int writes;
++ int seeks;
++ int unlinks;
++ } disk;
++
++ struct {
++ int accepts;
++ int sockets;
++ int connects;
++ int binds;
++ int closes;
++ int reads;
++ int writes;
++ int recvfroms;
++ int sendtos;
++ } sock;
++ int selects;
++ } syscalls;
++ int aborted_requests;
++
++ struct {
++ int files_cleaned;
++ int outs;
++ int ins;
++ } swap;
++};
++
++
++#endif /* STATCOUNTERS_H_ */
#define STATHIST_H_
#include "config.h"
++#include "typedefs.h"
/*
* "very generic" histogram;
#include "MemObject.h"
#include "ProtoPort.h"
#include "rfc1738.h"
++#include "StatCounters.h"
#include "StatHist.h"
#include "SquidTime.h"
#if USE_SSL
#include "fde.h"
#include "mgr/Registration.h"
#include "SquidTime.h"
++#include "StatCounters.h"
#include "StatHist.h"
#include "Store.h"
#include "fde.h"
#include "mgr/Registration.h"
#include "SquidTime.h"
++#include "StatCounters.h"
#include "StatHist.h"
#include "Store.h"
storeAppendPrintf(sentry, "\n");
storeAppendPrintf(sentry, "Histogram of events per incoming socket type\n");
storeAppendPrintf(sentry, "ICP Messages handled per comm_poll_icp_incoming() call:\n");
-- statHistDump(&f->comm_icp_incoming, sentry, statHistIntDumper);
++ f->comm_icp_incoming.dump(sentry, statHistIntDumper);
storeAppendPrintf(sentry, "DNS Messages handled per comm_poll_dns_incoming() call:\n");
-- statHistDump(&f->comm_dns_incoming, sentry, statHistIntDumper);
++ f->comm_dns_incoming.dump(sentry, statHistIntDumper);
storeAppendPrintf(sentry, "HTTP Messages handled per comm_poll_http_incoming() call:\n");
-- statHistDump(&f->comm_http_incoming, sentry, statHistIntDumper);
++ f->comm_http_incoming.dump(sentry, statHistIntDumper);
}
/* Called by async-io or diskd to speed up the polling */
#include "ICP.h"
#include "mgr/Registration.h"
#include "SquidTime.h"
--#include "Store.h"
++#include "StatCounters.h"
#include "StatHist.h"
++#include "Store.h"
#include "fde.h"
static int MAX_POLL_TIME = 1000; /* see also Comm::QuickPollRequired() */
#include "fde.h"
#include "mgr/Registration.h"
#include "SquidTime.h"
++#include "StatCounters.h"
#include "StatHist.h"
#include "Store.h"
/* for ERROR_BUF_SZ, BUFSIZ, MAXHTTPPORTS */
#include "defines.h"
--/* for iostats, StatCounters */
++#include "StatCounters.h"
++/* for iostats */
#include "structs.h"
int *wfd,
void **hIpc);
--
++class cd_guess_stats;
/* CacheDigest */
SQUIDCEXTERN CacheDigest *cacheDigestCreate(int capacity, int bpe);
SQUIDCEXTERN void cacheDigestDestroy(CacheDigest * cd);
/*
* hack to allow snmp access to the statistics counters
*/
++class StatCounters;
SQUIDCEXTERN StatCounters *snmpStatGet(int);
/* Vary support functions */
#include "cache_snmp.h"
#include "Store.h"
#include "mem_node.h"
++#include "StatCounters.h"
#include "StatHist.h"
#include "SquidMath.h"
#include "SquidTime.h"
domain_type *next;
};
--#if USE_CACHE_DIGESTS
--
--/* statistics for cache digests and other hit "predictors" */
--
--struct _cd_guess_stats {
-- /* public, read-only */
-- int true_hits;
-- int false_hits;
-- int true_misses;
-- int false_misses;
-- int close_hits; /* tmp, remove it later */
--};
--
--#endif
--
class PeerDigest;
struct peer {
int max_stale;
};
--/*
-- * if you add a field to StatCounters,
-- * you MUST sync statCountersInitSpecial, statCountersClean, and statCountersCopy
-- */
--
--#include "StatHist.h"
--
--struct _StatCounters {
--
-- struct {
-- int clients;
-- int requests;
-- int hits;
-- int mem_hits;
-- int disk_hits;
-- int errors;
-- kb_t kbytes_in;
-- kb_t kbytes_out;
-- kb_t hit_kbytes_out;
- StatHistLog miss_svc_time(300, 0.0, 3600000.0 * 3.0);
- StatHistLog nm_svc_time(300, 0.0, 3600000.0 * 3.0);
- StatHistLog nh_svc_time(300, 0.0, 3600000.0 * 3.0);
- StatHistLog hit_svc_time(300, 0.0, 3600000.0 * 3.0);
- StatHistLog all_svc_time(300, 0.0, 3600000.0 * 3.0);
- StatHist miss_svc_time;
- StatHist nm_svc_time;
- StatHist nh_svc_time;
- StatHist hit_svc_time;
- StatHist all_svc_time;
-- } client_http;
--
-- struct {
--
-- struct {
-- int requests;
-- int errors;
-- kb_t kbytes_in;
-- kb_t kbytes_out;
-- } all , http, ftp, other;
-- } server;
--
-- struct {
-- int pkts_sent;
-- int queries_sent;
-- int replies_sent;
-- int pkts_recv;
-- int queries_recv;
-- int replies_recv;
-- int hits_sent;
-- int hits_recv;
-- int replies_queued;
-- int replies_dropped;
-- kb_t kbytes_sent;
-- kb_t q_kbytes_sent;
-- kb_t r_kbytes_sent;
-- kb_t kbytes_recv;
-- kb_t q_kbytes_recv;
-- kb_t r_kbytes_recv;
- StatHistLog query_svc_time(300, 0.0, 1000000.0 * 60.0);
- StatHistLog reply_svc_time(300, 0.0, 1000000.0 * 60.0);
- StatHist query_svc_time;
- StatHist reply_svc_time;
-- int query_timeouts;
-- int times_used;
-- } icp;
--
-- struct {
-- int pkts_sent;
-- int pkts_recv;
-- } htcp;
--
-- struct {
-- int requests;
-- } unlink;
--
-- struct {
- StatHistLog svc_time(300, 0.0, 60000.0 * 10.0);
- StatHist svc_time;
-- } dns;
--
-- struct {
-- int times_used;
-- kb_t kbytes_sent;
-- kb_t kbytes_recv;
-- kb_t memory;
-- int msgs_sent;
-- int msgs_recv;
--#if USE_CACHE_DIGESTS
--
-- cd_guess_stats guess;
--#endif
--
-- StatHist on_xition_count;
-- } cd;
--
-- struct {
-- int times_used;
-- } netdb;
-- int page_faults;
-- unsigned long int select_loops;
-- int select_fds;
-- double select_time;
-- double cputime;
--
-- struct timeval timestamp;
-- StatHist comm_icp_incoming;
-- StatHist comm_dns_incoming;
-- StatHist comm_http_incoming;
-- StatHist select_fds_hist;
--
-- struct {
-- struct {
-- int opens;
-- int closes;
-- int reads;
-- int writes;
-- int seeks;
-- int unlinks;
-- } disk;
--
-- struct {
-- int accepts;
-- int sockets;
-- int connects;
-- int binds;
-- int closes;
-- int reads;
-- int writes;
-- int recvfroms;
-- int sendtos;
-- } sock;
-- int selects;
-- } syscalls;
-- int aborted_requests;
--
-- struct {
-- int files_cleaned;
-- int outs;
-- int ins;
-- } swap;
--};
--
--/* per header statistics */
--
--struct _HttpHeaderStat {
-- const char *label;
-- HttpHeaderMask *owner_mask;
--
-- StatHist hdrUCountDistr;
-- StatHist fieldTypeDistr;
-- StatHist ccTypeDistr;
-- StatHist scTypeDistr;
--
-- int parsedCount;
-- int ccParsedCount;
-- int scParsedCount;
-- int destroyedCount;
-- int busyDestroyedCount;
--};
--
struct _CacheDigest {
/* public, read-only */
typedef struct _HttpHeaderFieldAttrs HttpHeaderFieldAttrs;
--typedef struct _HttpHeaderStat HttpHeaderStat;
--
typedef struct _domain_ping domain_ping;
typedef struct _domain_type domain_type;
typedef struct _CommWriteStateData CommWriteStateData;
--typedef struct _StatCounters StatCounters;
--
typedef struct _storeSwapLogData storeSwapLogData;
--typedef struct _cd_guess_stats cd_guess_stats;
--
typedef struct _CacheDigest CacheDigest;
typedef struct _Version Version;