110#if XMALLOC_STATISTICS
111static void info_get_mallstat(
int,
int,
int,
void *);
218 i ? (1 << (i - 1)) + 1 : 1,
231 i ? (1 << (i - 1)) + 1 : 1,
244 snprintf(buf, 256,
"%-13s %-13s %-12s %-12s",
261 strcat(buf,
"SPECIAL,");
264 strcat(buf,
"REVALIDATE_ALWAYS,");
267 strcat(buf,
"DELAY_SENDING,");
270 strcat(buf,
"RELEASE_REQUEST,");
273 strcat(buf,
"REFRESH_REQUEST,");
276 strcat(buf,
"REVALIDATE_STALE,");
279 strcat(buf,
"DISPATCHED,");
282 strcat(buf,
"PRIVATE,");
285 strcat(buf,
"FWD_HDR_WAIT,");
288 strcat(buf,
"NEGCACHED,");
291 strcat(buf,
"VALIDATED,");
294 strcat(buf,
"BAD_LENGTH,");
297 strcat(buf,
"ABORTED,");
299 if ((t = strrchr(buf,
',')))
346 size_t statCount = 0;
374 sentry->
lock(
"statObjects");
416#if XMALLOC_STATISTICS
418info_get_mallstat(
int size,
int number,
int oldnum,
void *data)
436#if HAVE_MSTATS && HAVE_GNUMALLOC_H
526#if HAVE_MSTATS && HAVE_GNUMALLOC_H
530 stats.ms_bytes_total = ms.bytes_total;
532 stats.ms_bytes_free = ms.bytes_free;
561 if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) {
564 storeAppendPrintf(sentry,
"Service command line is: %s\n", WIN32_Service_Command_Line);
582 sentry->
append(
"\tNumber of clients accessing cache:\t(client_db off)\n", 52);
606 double fct = stats.
count > 1 ? stats.
count : 1.0;
610 storeAppendPrintf(sentry,
"\tAverage HTTP requests per minute since start:\t%.1f\n",
613 storeAppendPrintf(sentry,
"\tAverage ICP messages per minute since start:\t%.1f\n",
621 storeAppendPrintf(sentry,
"\tHits as %% of all requests:\t5min: %3.1f%%, 60min: %3.1f%%\n",
625 storeAppendPrintf(sentry,
"\tHits as %% of bytes sent:\t5min: %3.1f%%, 60min: %3.1f%%\n",
629 storeAppendPrintf(sentry,
"\tMemory hits as %% of hit requests:\t5min: %3.1f%%, 60min: %3.1f%%\n",
633 storeAppendPrintf(sentry,
"\tDisk hits as %% of hit requests:\t5min: %3.1f%%, 60min: %3.1f%%\n",
640 storeAppendPrintf(sentry,
"\tStorage Swap capacity:\t%4.1f%% used, %4.1f%% free\n",
647 storeAppendPrintf(sentry,
"\tStorage Mem capacity:\t%4.1f%% used, %4.1f%% free\n",
659 fct = stats.
count > 1 ? stats.
count * 1000.0 : 1000.0;
684 fct = stats.
count > 1 ? stats.
count * 1000000.0 : 1000000.0;
710#if HAVE_MSTATS && HAVE_GNUMALLOC_H
715 stats.ms_bytes_total / 1024);
718 stats.ms_bytes_free / 1024,
765#if XMALLOC_STATISTICS
769 storeAppendPrintf(sentry,
"%12s %15s %6s %12s\n",
"Alloc Size",
"Count",
"Delta",
"Alloc/sec");
770 malloc_statistics(info_get_mallstat, sentry);
780 double p = (i + 1) * 5 / 100.0;
808 double fct = stats.
count > 1 ? stats.
count * 1000.0 : 1000.0;
845 fct = stats.
count > 1 ? stats.
count * 1000000.0 : 1000000.0;
862#define XAVG(X) (dt ? (double) (f->X - l->X) / dt : 0.0)
871 assert(minutes > 0 || hours > 0);
875 if (minutes > 0 && hours == 0) {
882 }
else if (minutes == 0 && hours > 0) {
890 debugs(18,
DBG_IMPORTANT,
"ERROR: statAvgDump: Invalid args, minutes=" << minutes <<
", hours=" << hours);
1022 double fct = stats.
count > 1 ? stats.
count : 1.0;
1131 storeAppendPrintf(sentry,
"hit_validation.refusals.due_to_timeLimit = %f/sec\n",
1192 "Client-side Active Requests",
1196 "Active Cached Usernames",
1203 statGraphDump, 0, 1);
1232#if USE_POLL || USE_SELECT
1252 debugs(18, 5,
"statInit: Initializing...");
1299 debugs(18,
DBG_CRITICAL,
"WARNING: Median response time is " << i <<
" milliseconds");
1306 if (i > 0 && dt > 0.0) {
1316#if HAVE_MSTATS && HAVE_GNUMALLOC_H
1317 struct mstats ms = mstats();
1321 debugs(18,
DBG_CRITICAL,
"WARNING: Memory usage at " << ((
unsigned long int)(i >> 20)) <<
" MB");
1409#if USE_CACHE_DIGESTS
1523#if USE_CACHE_DIGESTS
1577#if USE_CACHE_DIGESTS
1582 static const SBuf label(
"all peers");
1605 storeAppendPrintf(sentry,
"peer digests are disabled; no stats is available.\n");
1674 debugs(49, 5,
"statPctileSvc: unknown type.");
1690 const auto recentMinutes = 5;
1743#if USE_CACHE_DIGESTS
1751#if USE_CACHE_DIGESTS
1783 const char *p =
nullptr;
1789 if (conn !=
nullptr) {
1846#define GRAPH_PER_MIN(Y) \
1847 for (i=0;i<(N_COUNT_HIST-2);++i) { \
1848 dt = tvSubDsec(CountHist[i+1].timestamp, CountHist[i].timestamp); \
1851 storeAppendPrintf(e, "%lu,%0.2f:", \
1852 CountHist[i].timestamp.tv_sec, \
1853 ((CountHist[i].Y - CountHist[i+1].Y) / dt)); \
1856#define GRAPH_PER_HOUR(Y) \
1857 for (i=0;i<(N_COUNT_HOUR_HIST-2);++i) { \
1858 dt = tvSubDsec(CountHourHist[i+1].timestamp, CountHourHist[i].timestamp); \
1861 storeAppendPrintf(e, "%lu,%0.2f:", \
1862 CountHourHist[i].timestamp.tv_sec, \
1863 ((CountHourHist[i].Y - CountHourHist[i+1].Y) / dt)); \
1866#define GRAPH_TITLE(X,Y) storeAppendPrintf(e,"%s\t%s\t",X,Y);
1867#define GRAPH_END storeAppendPrintf(e,"\n");
1869#define GENGRAPH(X,Y,Z) \
1881 GENGRAPH(client_http.requests,
"client_http.requests",
"Client HTTP requests/sec");
1882 GENGRAPH(client_http.hits,
"client_http.hits",
"Client HTTP hits/sec");
1883 GENGRAPH(client_http.errors,
"client_http.errors",
"Client HTTP errors/sec");
1884 GENGRAPH(client_http.kbytes_in.kb,
"client_http.kbytes_in",
"Client HTTP kbytes_in/sec");
1885 GENGRAPH(client_http.kbytes_out.kb,
"client_http.kbytes_out",
"Client HTTP kbytes_out/sec");
1889 GENGRAPH(
server.all.requests,
"server.all.requests",
"Server requests/sec");
1890 GENGRAPH(
server.all.errors,
"server.all.errors",
"Server errors/sec");
1891 GENGRAPH(
server.all.kbytes_in.kb,
"server.all.kbytes_in",
"Server total kbytes_in/sec");
1892 GENGRAPH(
server.all.kbytes_out.kb,
"server.all.kbytes_out",
"Server total kbytes_out/sec");
1894 GENGRAPH(
server.http.requests,
"server.http.requests",
"Server HTTP requests/sec");
1895 GENGRAPH(
server.http.errors,
"server.http.errors",
"Server HTTP errors/sec");
1896 GENGRAPH(
server.http.kbytes_in.kb,
"server.http.kbytes_in",
"Server HTTP kbytes_in/sec");
1897 GENGRAPH(
server.http.kbytes_out.kb,
"server.http.kbytes_out",
"Server HTTP kbytes_out/sec");
1899 GENGRAPH(
server.ftp.requests,
"server.ftp.requests",
"Server FTP requests/sec");
1900 GENGRAPH(
server.ftp.errors,
"server.ftp.errors",
"Server FTP errors/sec");
1901 GENGRAPH(
server.ftp.kbytes_in.kb,
"server.ftp.kbytes_in",
"Server FTP kbytes_in/sec");
1902 GENGRAPH(
server.ftp.kbytes_out.kb,
"server.ftp.kbytes_out",
"Server FTP kbytes_out/sec");
1904 GENGRAPH(
server.other.requests,
"server.other.requests",
"Server other requests/sec");
1905 GENGRAPH(
server.other.errors,
"server.other.errors",
"Server other errors/sec");
1906 GENGRAPH(
server.other.kbytes_in.kb,
"server.other.kbytes_in",
"Server other kbytes_in/sec");
1907 GENGRAPH(
server.other.kbytes_out.kb,
"server.other.kbytes_out",
"Server other kbytes_out/sec");
1909 GENGRAPH(icp.pkts_sent,
"icp.pkts_sent",
"ICP packets sent/sec");
1910 GENGRAPH(icp.pkts_recv,
"icp.pkts_recv",
"ICP packets received/sec");
1911 GENGRAPH(icp.kbytes_sent.kb,
"icp.kbytes_sent",
"ICP kbytes_sent/sec");
1912 GENGRAPH(icp.kbytes_recv.kb,
"icp.kbytes_recv",
"ICP kbytes_received/sec");
1917 GENGRAPH(unlink.requests,
"unlink.requests",
"Cache File unlink requests/sec");
1918 GENGRAPH(page_faults,
"page_faults",
"System Page Faults/sec");
1919 GENGRAPH(select_loops,
"select_loops",
"System Select Loop calls/sec");
1920 GENGRAPH(cputime,
"cputime",
"CPU utilisation");
void cacheDigestGuessStatsReport(const CacheDigestGuessStats *stats, StoreEntry *sentry, const SBuf &label)
const CachePeers & CurrentCachePeers()
#define SQUIDSBUFPRINT(s)
double statHistDeltaMedian(const StatHist &A, const StatHist &B)
double statHistDeltaPctile(const StatHist &A, const StatHist &B, double pctile)
static char server[MAXLINE]
#define CBDATA_CLASS_INIT(type)
#define CBDATA_CLASS(type)
struct timeval start_time
The time the master transaction started.
class AccessLogEntry::CacheDetails cache
char const * username() const
static void CredentialsCacheStats(StoreEntry *output)
struct ClientHttpRequest::Out out
HttpRequest *const request
ConnStateData * getConn() const
size_t req_sz
raw request size on input, not current request size
StoreEntry * storeEntry() const
const LogTags & loggingTags() const
the processing tags associated with this request transaction.
const AccessLogEntry::Pointer al
access.log entry
static DelayId DelayClient(ClientHttpRequest *, HttpReply *reply=nullptr)
Auth::UserRequest::Pointer auth_user_request
static const int histSize
char * toUrl(char *buf, unsigned int len) const
void append(const char *c, int sz) override
void init(mb_size_t szInit, mb_size_t szMax)
StoreIOState::Pointer sio
void stat(MemBuf *mb) const
ssize_t currentLevel() const
store traffic and resource counters
double icp_query_timeouts
double server_other_kbytes_in
double server_other_kbytes_out
double client_http_kbytes_in
double icp_replies_queued
double client_http_errors
double server_other_requests
double server_http_kbytes_out
double server_ftp_requests
double server_ftp_kbytes_in
double server_ftp_kbytes_out
double client_http_requests
double hitValidationRefusalsDueToZeroSize
double server_all_kbytes_in
double hitValidationRefusalsDueToTimeLimit
double swap_files_cleaned
struct timeval sample_time
double client_http_hit_kbytes_out
double hitValidationRefusalsDueToLocking
double server_all_requests
double hitValidationFailures
double server_http_errors
double hitValidationAttempts
double client_http_kbytes_out
double server_other_errors
double server_http_kbytes_in
double server_http_requests
double server_all_kbytes_out
static Pointer Create(const CommandPointer &cmd)
double client_http_clients
double not_modified_replies60
double request_hit_mem_ratio5
double request_hit_disk_ratio60
double request_hit_mem_ratio60
double request_failure_ratio
double request_hit_ratio60
double avg_client_http_requests
double request_hit_ratio5
double client_http_requests
struct timeval squid_start
double not_modified_replies5
double icp_replies_queued
double request_hit_disk_ratio5
StoreInfoStats store
disk and memory cache statistics
struct timeval current_time
static Pointer Create(const CommandPointer &cmd)
double server_other_requests
double client_http_kbytes_in
double icp_reply_median_svc_time
double syscalls_sock_accepts
double syscalls_sock_closes
double client_http_kbytes_out
double dns_median_svc_time
double server_ftp_requests
double icp_replies_queued
double client_http_nm_median_svc_time
double server_other_kbytes_out
double syscalls_disk_unlinks
double syscalls_sock_reads
double hitValidationRefusalsDueToTimeLimit
double server_http_errors
double syscalls_sock_connects
double server_all_kbytes_in
struct timeval sample_start_time
double hitValidationRefusalsDueToZeroSize
double server_http_kbytes_in
double swap_files_cleaned
double client_http_hit_median_svc_time
double client_http_all_median_svc_time
struct timeval sample_end_time
double client_http_errors
double syscalls_disk_seeks
double server_ftp_kbytes_out
double hitValidationRefusalsDueToLocking
double server_http_kbytes_out
double client_http_nh_median_svc_time
double server_all_requests
double client_http_requests
double hitValidationAttempts
double syscalls_disk_reads
double server_other_kbytes_in
double hitValidationFailures
double syscalls_disk_opens
double syscalls_sock_sockets
double client_http_miss_median_svc_time
double server_other_errors
double server_all_kbytes_out
double server_ftp_kbytes_in
double syscalls_sock_writes
double server_http_requests
double syscalls_sock_binds
double average_select_fd_period
double syscalls_disk_closes
double icp_query_median_svc_time
double syscalls_sock_recvfroms
double icp_query_timeouts
double syscalls_disk_writes
double syscalls_sock_sendtos
static Pointer Create60min(const CommandPointer &cmd)
static Pointer Create5min(const CommandPointer &cmd)
store size histograms of network read() from peer server
double ftp_read_hist[IoStats::histSize]
double http_read_hist[IoStats::histSize]
static Pointer Create(const CommandPointer &cmd)
store service times for 5 and 60 min
double dns_lookups60[seriesSize]
double http_requests5[seriesSize]
double icp_queries60[seriesSize]
double not_modified_replies5[seriesSize]
double dns_lookups5[seriesSize]
double not_modified_replies60[seriesSize]
double cache_hits5[seriesSize]
double cache_misses60[seriesSize]
double near_hits60[seriesSize]
double icp_queries5[seriesSize]
double near_hits5[seriesSize]
double http_requests60[seriesSize]
double cache_hits60[seriesSize]
double cache_misses5[seriesSize]
static Pointer Create(const CommandPointer &cmd)
void appendf(const char *fmt,...) PRINTF_FORMAT_ARG2
Append operation with printf-style arguments.
const char * rawContent() const
size_type length() const
Returns the number of bytes stored in SBuf.
size_type spaceSize() const
Pipeline pipeline
set of requests waiting to be serviced
Comm::ConnectionPointer clientConnection
SBuf inBuf
read I/O buffer for the client connection
struct SquidConfig::@90 onoff
struct SquidConfig::@98 warnings
struct SquidConfig::@88 Store
struct StatCounters::@113 swap
CacheDigestGuessStats guess
ByteCounter r_kbytes_sent
unsigned long int select_loops
struct StatCounters::@105::@115 http
uint64_t refusalsDueToZeroSize
uint64_t refusalsDueToTimeLimit
ByteCounter q_kbytes_sent
struct StatCounters::@114 hitValidation
ByteCounter q_kbytes_recv
struct StatCounters::@107 htcp
struct StatCounters::@105::@115 ftp
struct StatCounters::@109 dns
struct StatCounters::@105 server
struct StatCounters::@110 cd
ByteCounter r_kbytes_recv
ByteCounter hit_kbytes_out
struct StatCounters::@105::@115 other
struct StatCounters::@108 unlink
struct StatCounters::@106 icp
struct StatCounters::@104 client_http
struct StatCounters::@105::@115 all
uint64_t refusalsDueToLocking
void logInit(unsigned int capacity, double min, double max)
void enumInit(unsigned int last_enum)
void dump(StoreEntry *sentry, StatHistBinDumper *bd) const
StoreSearchPointer theSearch
int locks() const
returns a local concurrent use counter, for debugging
int unlock(const char *context)
swap_status_t swap_status
void lock(const char *context)
bool checkDeferRead(int fd) const
const char * describeTimestamps() const
const char * getMD5Text() const
sfileno swap_filen
unique ID inside a cache_dir for swapped out entries; -1 for others
ping_status_t ping_status
void append(char const *, int) override
Appends a c-string to existing packed data.
store_status_t store_status
double capacity
the size limit
double count
number of cached objects
double meanObjectSize() const
mean size of a cached object
double available() const
number of unused bytes
double size
bytes currently in use
double open_disk_fd
number of opened disk files
double store_entry_count
number of StoreEntry objects in existence
Mem mem
all cache_dirs stats
double mem_object_count
number of MemObject objects in existence
virtual StoreEntry * currentItem()=0
virtual bool isDone() const =0
void getStats(StoreInfoStats &stats) const override
collect statistics
char const * termedBuf() const
static void DumpStats(StoreEntry *)
#define debugs(SECTION, LEVEL, CONTENT)
#define N_COUNT_HOUR_HIST
#define EBIT_TEST(flag, bit)
dlink_list ClientActiveRequests
@ RELEASE_REQUEST
prohibits making the key public
@ ENTRY_REVALIDATE_ALWAYS
void eventAdd(const char *name, EVH *func, void *arg, double when, int weight, bool cbdata)
const char * swapStatusStr[]
struct timeval squid_start
const char * pingStatusStr[]
int CacheDigestHashFuncCount
const char * memStatusStr[]
const char * version_string
CacheDigest * store_digest
const char * storeStatusStr[]
double request_failure_ratio
const char * sslGetUserEmail(SSL *ssl)
#define MAX_IPSTRLEN
Length of buffer that needs to be allocated to old a null-terminated IP-string.
bool IsConnOpen(const Comm::ConnectionPointer &conn)
double doublePercent(const double, const double)
size_t GlobalStats(PoolStats &)
void CloseKidSection(StoreEntry *, Format)
void RegisterAction(char const *action, char const *desc, OBJH *handler, Protected, Atomic, Format)
Controller & Root()
safely access controller singleton
const char * FormatRfc1123(time_t)
void peerDigestStatsReport(const PeerDigest *pd, StoreEntry *e)
#define LOCAL_ARRAY(type, name, size)
static int statObjectsOpenfdFilter(const StoreEntry *e)
static double statPctileSvc(double, int, int)
unsigned int mem_pool_alloc_calls
static OBJH statClientRequests
void DumpInfo(Mgr::InfoActionData &stats, StoreEntry *sentry)
void GetInfo(Mgr::InfoActionData &stats)
static OBJH stat_objects_get
static void statAvgDump(StoreEntry *, int minutes, int hours)
void GetServiceTimesStats(Mgr::ServiceTimesActionData &stats)
StatCounters * snmpStatGet(int minutes)
double statRequestHitMemoryRatio(int minutes)
static OBJH stat_vmobjects_get
static void statRegisterWithCacheManager(void)
static OBJH statDigestBlob
static OBJH statUtilization
void DumpServiceTimesStats(Mgr::ServiceTimesActionData &stats, StoreEntry *sentry)
static void statObjectsStart(StoreEntry *sentry, STOBJFLT *filter)
double statRequestHitRatio(int minutes)
static void statCountersInit(StatCounters *C)
void GetAvgStat(Mgr::IntervalActionData &stats, int minutes, int hours)
static StatCounters CountHourHist[N_COUNT_HOUR_HIST]
static OBJH statCountersHistograms
void GetIoStats(Mgr::IoActionData &stats)
double statByteHitRatio(int minutes)
StatCounters CountHist[N_COUNT_HIST]
static OBJH statPeerSelect
void DumpIoStats(Mgr::IoActionData &stats, StoreEntry *sentry)
int STOBJFLT(const StoreEntry *)
static void statStoreEntry(MemBuf *mb, StoreEntry *e)
static int statObjectsVmFilter(const StoreEntry *e)
double statRequestHitDiskRatio(int minutes)
void GetCountersStats(Mgr::CountersActionData &stats)
void DumpMallocStatistics(StoreEntry *sentry)
static void statCountersInitSpecial(StatCounters *C)
static int NCountHourHist
const char * storeEntryFlags(const StoreEntry *entry)
bool statSawRecentRequests()
void DumpAvgStat(Mgr::IntervalActionData &stats, StoreEntry *sentry)
void DumpCountersStats(Mgr::CountersActionData &stats, StoreEntry *sentry)
static OBJH statOpenfdObj
static const char * describeStatuses(const StoreEntry *)
static void statAvgTick(void *notused)
static double statCPUUsage(int minutes)
static OBJH statCountersDump
unsigned int mem_pool_free_calls
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
int storePendingNClients(const StoreEntry *e)
void storeDigestReport(StoreEntry *e)
uint64_t size
Response header and body bytes written to the client connection.
double current_dtime
the current UNIX time in seconds (with microsecond precision)
double tvSubDsec(struct timeval t1, struct timeval t2)
struct timeval current_time
the current UNIX time in timeval {seconds, microseconds} format
double xdiv(double nom, double denom)
int xpercentInt(double part, double whole)