#include "squid.h"
#include "AccessLogEntry.h"
#include "CacheDigest.h"
#include "CachePeer.h"
#include "CachePeers.h"
#include "client_side.h"
#include "client_side_request.h"
#include "comm/Connection.h"
#include "comm/Loops.h"
#include "event.h"
#include "fde.h"
#include "format/Token.h"
#include "globals.h"
#include "http/Stream.h"
#include "HttpRequest.h"
#include "IoStats.h"
#include "mem/Pool.h"
#include "mem/Stats.h"
#include "mem_node.h"
#include "MemBuf.h"
#include "MemObject.h"
#include "mgr/CountersAction.h"
#include "mgr/FunAction.h"
#include "mgr/InfoAction.h"
#include "mgr/IntervalAction.h"
#include "mgr/IoAction.h"
#include "mgr/Registration.h"
#include "mgr/ServiceTimesAction.h"
#include "neighbors.h"
#include "PeerDigest.h"
#include "SquidConfig.h"
#include "SquidMath.h"
#include "stat.h"
#include "StatCounters.h"
#include "Store.h"
#include "store_digest.h"
#include "StoreClient.h"
#include "tools.h"
#include "auth/UserRequest.h"
#include "DelayId.h"
#include "ssl/support.h"
#include "comm.h"
#include "StoreSearch.h"
Go to the source code of this file.
Classes | |
class | StatObjectsState |
Macros | |
#define | XAVG(X) (dt ? (double) (f->X - l->X) / dt : 0.0) |
Typedefs | |
typedef int | STOBJFLT(const StoreEntry *) |
Variables | |
static OBJH | stat_objects_get |
static OBJH | stat_vmobjects_get |
static OBJH | statOpenfdObj |
static EVH | statObjects |
static OBJH | statCountersDump |
static OBJH | statPeerSelect |
static OBJH | statDigestBlob |
static OBJH | statUtilization |
static OBJH | statCountersHistograms |
static OBJH | statClientRequests |
StatCounters | CountHist [N_COUNT_HIST] |
static int | NCountHist = 0 |
static StatCounters | CountHourHist [N_COUNT_HOUR_HIST] |
static int | NCountHourHist = 0 |
unsigned int | mem_pool_alloc_calls |
unsigned int | mem_pool_free_calls |
Macro Definition Documentation
◆ XAVG
Typedef Documentation
◆ STOBJFLT
typedef int STOBJFLT(const StoreEntry *) |
Function Documentation
◆ describeStatuses()
|
static |
Definition at line 241 of file stat.cc.
References LOCAL_ARRAY, StoreEntry::mem_status, memStatusStr, StoreEntry::ping_status, pingStatusStr, StoreEntry::store_status, storeStatusStr, StoreEntry::swap_status, and swapStatusStr.
Referenced by statStoreEntry().
◆ DumpAvgStat()
void DumpAvgStat | ( | Mgr::IntervalActionData & | stats, |
StoreEntry * | sentry | ||
) |
Definition at line 1001 of file stat.cc.
References Math::doublePercent(), Time::FormatRfc1123(), Ping::stats, and storeAppendPrintf().
Referenced by Mgr::IntervalAction::dump(), and statAvgDump().
◆ DumpCountersStats()
void DumpCountersStats | ( | Mgr::CountersActionData & | stats, |
StoreEntry * | sentry | ||
) |
Definition at line 1438 of file stat.cc.
References Time::FormatRfc1123(), Ping::stats, and storeAppendPrintf().
Referenced by Mgr::CountersAction::dump(), and statCountersDump().
◆ DumpInfo()
void DumpInfo | ( | Mgr::InfoActionData & | stats, |
StoreEntry * | sentry | ||
) |
Definition at line 554 of file stat.cc.
References APP_SHORTNAME, StoreEntry::append(), SquidConfig::client_db, Config, Math::doublePercent(), Time::FormatRfc1123(), Mem::GlobalStats(), SquidConfig::onoff, service_name, SQUIDSBUFPH, SQUIDSBUFPRINT, Ping::stats, storeAppendPrintf(), and version_string.
Referenced by Mgr::InfoAction::dump().
◆ DumpIoStats()
void DumpIoStats | ( | Mgr::IoActionData & | stats, |
StoreEntry * | sentry | ||
) |
Definition at line 208 of file stat.cc.
References Math::doublePercent(), IoStats::histSize, Ping::stats, and storeAppendPrintf().
Referenced by Mgr::IoAction::dump().
◆ DumpMallocStatistics()
void DumpMallocStatistics | ( | StoreEntry * | sentry | ) |
Definition at line 764 of file stat.cc.
References current_dtime, storeAppendPrintf(), xm_deltat, and xm_time.
Referenced by Mgr::InfoAction::dump().
◆ DumpServiceTimesStats()
void DumpServiceTimesStats | ( | Mgr::ServiceTimesActionData & | stats, |
StoreEntry * | sentry | ||
) |
Definition at line 806 of file stat.cc.
References Mgr::ServiceTimesActionData::seriesSize, Ping::stats, and storeAppendPrintf().
Referenced by Mgr::ServiceTimesAction::dump().
◆ GetAvgStat()
void GetAvgStat | ( | Mgr::IntervalActionData & | stats, |
int | minutes, | ||
int | hours | ||
) |
Definition at line 865 of file stat.cc.
References StatCounters::allSvcTime, assert, StatCounters::client_http, CountHist, CountHourHist, StatCounters::cputime, DBG_IMPORTANT, debugs, StatCounters::dns, StatCounters::hitSvcTime, StatCounters::icp, StatCounters::missSvcTime, N_COUNT_HIST, N_COUNT_HOUR_HIST, StatCounters::nearHitSvcTime, StatCounters::nearMissSvcTime, StatCounters::querySvcTime, StatCounters::replySvcTime, StatCounters::select_fds, StatCounters::select_fds_hist, StatCounters::select_time, server, statHistDeltaMedian(), Ping::stats, StatCounters::svcTime, StatCounters::timestamp, tvSubDsec(), and XAVG.
Referenced by Mgr::IntervalAction::collect(), and statAvgDump().
◆ GetCountersStats()
void GetCountersStats | ( | Mgr::CountersActionData & | stats | ) |
Definition at line 1356 of file stat.cc.
References StatCounters::aborted_requests, StatCounters::all, StatCounters::attempts, StatCounters::cd, StatCounters::client_http, StatCounters::cputime, current_time, StatCounters::errors, StatCounters::failures, StatCounters::files_cleaned, StatCounters::ftp, StatCounters::hit_kbytes_out, StatCounters::hits, StatCounters::hitValidation, StatCounters::http, StatCounters::icp, StatCounters::ins, ByteCounter::kb, StatCounters::kbytes_in, StatCounters::kbytes_out, StatCounters::kbytes_recv, StatCounters::kbytes_sent, CacheDigest::mask_size, StatCounters::memory, StatCounters::msgs_recv, StatCounters::msgs_sent, StatCounters::other, StatCounters::outs, StatCounters::page_faults, StatCounters::pkts_recv, StatCounters::pkts_sent, StatCounters::q_kbytes_recv, StatCounters::q_kbytes_sent, StatCounters::queries_recv, StatCounters::queries_sent, StatCounters::query_timeouts, StatCounters::r_kbytes_recv, StatCounters::r_kbytes_sent, StatCounters::refusalsDueToLocking, StatCounters::refusalsDueToTimeLimit, StatCounters::refusalsDueToZeroSize, StatCounters::replies_queued, StatCounters::replies_recv, StatCounters::replies_sent, StatCounters::requests, rusage_cputime(), rusage_pagefaults(), StatCounters::select_loops, StatCounters::server, squid_getrusage(), statCounter, Ping::stats, store_digest, StatCounters::swap, StatCounters::times_used, StatCounters::timestamp, tvSubDsec(), and StatCounters::unlink.
Referenced by Mgr::CountersAction::collect(), and statCountersDump().
◆ GetInfo()
void GetInfo | ( | Mgr::InfoActionData & | stats | ) |
Definition at line 431 of file stat.cc.
References Mem::PoolMeter::alloc, Biggest_FD, StatCounters::client_http, StatCounters::clients, Mem::PoolMeter::mgb_t::count, current_time, Mem::Meter::currentLevel(), Math::doublePercent(), fdNFree(), Mem::PoolMeter::gb_freed, Mem::PoolMeter::gb_saved, Store::Controller::getStats(), Mem::GlobalStats(), StatCounters::htcp, StatCounters::icp, Mem::PoolStats::meter, Number_FD, Opening_FD, PCTILE_DNS, PCTILE_HIT, PCTILE_HTTP, PCTILE_ICP_QUERY, PCTILE_MISS, PCTILE_NH, PCTILE_NM, StatCounters::pkts_recv, StatCounters::pkts_sent, StatCounters::replies_queued, request_failure_ratio, StatCounters::requests, RESERVED_FD, Store::Root(), rusage_cputime(), rusage_maxrss(), rusage_pagefaults(), StatCounters::select_loops, squid_getrusage(), Squid_MaxFD, squid_start, statByteHitRatio(), statCounter, statCPUUsage(), statPctileSvc(), statRequestHitDiskRatio(), statRequestHitMemoryRatio(), statRequestHitRatio(), Ping::stats, tvSubDsec(), and StatCounters::unlink.
Referenced by Mgr::InfoAction::collect().
◆ GetIoStats()
void GetIoStats | ( | Mgr::IoActionData & | stats | ) |
Definition at line 190 of file stat.cc.
References IoStats::Ftp, IoStats::histSize, IoStats::Http, IOStats, IoStats::read_hist, IoStats::reads, and Ping::stats.
Referenced by Mgr::IoAction::collect().
◆ GetServiceTimesStats()
void GetServiceTimesStats | ( | Mgr::ServiceTimesActionData & | stats | ) |
Definition at line 778 of file stat.cc.
References PCTILE_DNS, PCTILE_HIT, PCTILE_HTTP, PCTILE_ICP_QUERY, PCTILE_MISS, PCTILE_NH, PCTILE_NM, Mgr::ServiceTimesActionData::seriesSize, statPctileSvc(), and Ping::stats.
Referenced by Mgr::ServiceTimesAction::collect().
◆ snmpStatGet()
StatCounters * snmpStatGet | ( | int | minutes | ) |
◆ stat5minClientRequests()
int stat5minClientRequests | ( | void | ) |
Definition at line 1687 of file stat.cc.
References assert, StatCounters::client_http, CountHist, N_COUNT_HIST, StatCounters::requests, and statCounter.
Referenced by peerRefreshDNS().
◆ stat_objects_get()
|
static |
Definition at line 382 of file stat.cc.
References statObjectsStart().
◆ stat_vmobjects_get()
|
static |
Definition at line 394 of file stat.cc.
References statObjectsStart(), and statObjectsVmFilter().
◆ statAvgDump()
|
static |
Definition at line 856 of file stat.cc.
References DumpAvgStat(), GetAvgStat(), and Ping::stats.
Referenced by statDigestBlob(), and statUtilization().
◆ statAvgTick()
|
static |
Definition at line 1271 of file stat.cc.
References Config, COUNT_INTERVAL, CountHist, CountHourHist, StatCounters::cputime, current_time, DBG_CRITICAL, debugs, eventAdd(), SquidConfig::high_memory, SquidConfig::high_pf, SquidConfig::high_rptm, int, N_COUNT_HIST, N_COUNT_HOUR_HIST, NCountHist, NCountHourHist, StatCounters::page_faults, PCTILE_HTTP, rusage_cputime(), rusage_pagefaults(), squid_getrusage(), statAvgTick(), statCounter, statPctileSvc(), StatCounters::timestamp, tvSubDsec(), and SquidConfig::warnings.
Referenced by statAvgTick(), and statInit().
◆ statByteHitRatio()
Definition at line 1732 of file stat.cc.
References StatCounters::all, assert, StatCounters::cd, StatCounters::client_http, CountHist, DBG_IMPORTANT, debugs, Math::doublePercent(), ByteCounter::kb, StatCounters::kbytes_in, StatCounters::kbytes_out, StatCounters::kbytes_recv, N_COUNT_HIST, and StatCounters::server.
Referenced by GetInfo(), and snmp_prfProtoFn().
◆ statClientRequests()
|
static |
Definition at line 1768 of file stat.cc.
References ClientHttpRequest::al, assert, HttpRequest::auth_user_request, LogTags::c_str(), AccessLogEntry::cache, ClientActiveRequests, conn, current_time, dash_str, dlink_node::data, DelayId::DelayClient(), HttpRequest::extacl_user, fd_table, ClientHttpRequest::getConn(), StoreEntry::getMD5Text(), dlink_list::head, Comm::IsConnOpen(), ClientHttpRequest::loggingTags(), MAX_IPSTRLEN, dlink_node::next, ClientHttpRequest::Out::offset, ClientHttpRequest::out, PRId64, ClientHttpRequest::req_sz, ClientHttpRequest::request, ClientHttpRequest::Out::size, String::size(), sslGetUserEmail(), AccessLogEntry::CacheDetails::start_time, storeAppendPrintf(), ClientHttpRequest::storeEntry(), String::termedBuf(), tvSubDsec(), ClientHttpRequest::uri, and Auth::UserRequest::username().
◆ statCountersDump()
|
static |
Definition at line 1348 of file stat.cc.
References DumpCountersStats(), GetCountersStats(), and Ping::stats.
◆ statCountersHistograms()
|
static |
Definition at line 1325 of file stat.cc.
References StatCounters::allSvcTime, StatCounters::client_http, StatCounters::dns, StatHist::dump(), StatCounters::hitSvcTime, StatCounters::icp, StatCounters::missSvcTime, StatCounters::nearHitSvcTime, StatCounters::nearMissSvcTime, StatCounters::querySvcTime, StatCounters::replySvcTime, StatCounters::select_fds_hist, statCounter, storeAppendPrintf(), and StatCounters::svcTime.
◆ statCountersInit()
|
static |
Definition at line 1240 of file stat.cc.
References assert, C, and statCountersInitSpecial().
Referenced by statInit().
◆ statCountersInitSpecial()
|
static |
Definition at line 1210 of file stat.cc.
References C, CacheDigestHashFuncCount, INCOMING_DNS_MAX, INCOMING_TCP_MAX, and INCOMING_UDP_MAX.
Referenced by statCountersInit().
◆ statCPUUsage()
Definition at line 1694 of file stat.cc.
References assert, CountHist, Math::doublePercent(), N_COUNT_HIST, and tvSubDsec().
Referenced by GetInfo().
◆ statDigestBlob()
|
static |
Definition at line 1609 of file stat.cc.
References statAvgDump(), statCountersDump, statCountersHistograms, statPeerSelect, storeAppendPrintf(), and storeDigestReport().
◆ statInit()
void statInit | ( | void | ) |
Definition at line 1248 of file stat.cc.
References ClientActiveRequests, COUNT_INTERVAL, CountHist, CountHourHist, debugs, eventAdd(), dlink_list::head, N_COUNT_HIST, N_COUNT_HOUR_HIST, statAvgTick(), statCounter, statCountersInit(), statRegisterWithCacheManager(), and dlink_list::tail.
Referenced by mainInitialize().
◆ statObjects()
|
static |
Definition at line 324 of file stat.cc.
References StoreEntry::append(), MemBuf::buf, StoreEntry::buffer(), StoreEntry::checkDeferRead(), MemBuf::clean(), StoreEntry::complete(), Config, StoreSearch::currentItem(), EBIT_TEST, ENTRY_ABORTED, eventAdd(), StatObjectsState::filter, StoreEntry::flags, StoreEntry::flush(), MemBuf::init(), StoreSearch::isDone(), KidIdentifier, SquidConfig::objectsPerBucket, StatObjectsState::sentry, MemBuf::size, statObjects, statStoreEntry(), SquidConfig::Store, storeAppendPrintf(), StatObjectsState::theSearch, StoreEntry::unlock(), and UsingSmp().
◆ statObjectsOpenfdFilter()
|
static |
Definition at line 400 of file stat.cc.
References StoreEntry::mem_obj, MemObject::SwapOut::sio, and MemObject::swapout.
Referenced by statOpenfdObj().
◆ statObjectsStart()
|
static |
Definition at line 369 of file stat.cc.
References eventAdd(), StatObjectsState::filter, StoreEntry::lock(), Store::Root(), Store::Controller::search(), StatObjectsState::sentry, statObjects, and StatObjectsState::theSearch.
Referenced by stat_objects_get(), stat_vmobjects_get(), and statOpenfdObj().
◆ statObjectsVmFilter()
|
static |
Definition at line 388 of file stat.cc.
References StoreEntry::mem_obj.
Referenced by stat_vmobjects_get().
◆ statOpenfdObj()
|
static |
Definition at line 412 of file stat.cc.
References statObjectsOpenfdFilter(), and statObjectsStart().
◆ statPctileSvc()
Definition at line 1624 of file stat.cc.
References StatCounters::allSvcTime, assert, StatCounters::client_http, CountHist, debugs, StatCounters::dns, StatCounters::hitSvcTime, StatCounters::icp, StatCounters::missSvcTime, N_COUNT_HIST, StatCounters::nearHitSvcTime, StatCounters::nearMissSvcTime, PCTILE_DNS, PCTILE_HIT, PCTILE_HTTP, PCTILE_ICP_QUERY, PCTILE_MISS, PCTILE_NH, PCTILE_NM, StatCounters::querySvcTime, statHistDeltaPctile(), and StatCounters::svcTime.
Referenced by GetInfo(), GetServiceTimesStats(), and statAvgTick().
◆ statPeerSelect()
|
static |
Definition at line 1574 of file stat.cc.
References cacheDigestGuessStatsReport(), StatCounters::cd, CurrentCachePeers(), StatCounters::guess, StatCounters::icp, peerDigestStatsReport(), statCounter, storeAppendPrintf(), StatCounters::times_used, and xpercentInt().
◆ statRegisterWithCacheManager()
|
static |
Definition at line 1165 of file stat.cc.
References Mgr::CountersAction::Create(), Mgr::InfoAction::Create(), Mgr::IoAction::Create(), Mgr::ServiceTimesAction::Create(), Mgr::IntervalAction::Create5min(), Mgr::IntervalAction::Create60min(), Auth::User::CredentialsCacheStats(), fde::DumpStats(), Mgr::RegisterAction(), stat_objects_get, stat_vmobjects_get, statClientRequests, statCountersHistograms, statDigestBlob, statOpenfdObj, statPeerSelect, and statUtilization.
Referenced by statInit().
◆ statRequestHitDiskRatio()
Definition at line 1722 of file stat.cc.
References assert, StatCounters::client_http, CountHist, StatCounters::disk_hits, Math::doublePercent(), StatCounters::hits, and N_COUNT_HIST.
Referenced by GetInfo().
◆ statRequestHitMemoryRatio()
Definition at line 1712 of file stat.cc.
References assert, StatCounters::client_http, CountHist, Math::doublePercent(), StatCounters::hits, StatCounters::mem_hits, and N_COUNT_HIST.
Referenced by GetInfo().
◆ statRequestHitRatio()
Definition at line 1702 of file stat.cc.
References assert, StatCounters::client_http, CountHist, Math::doublePercent(), StatCounters::hits, N_COUNT_HIST, and StatCounters::requests.
Referenced by GetInfo(), and snmp_prfProtoFn().
◆ statStoreEntry()
|
static |
Definition at line 306 of file stat.cc.
References MemBuf::append(), Packable::appendf(), describeStatuses(), StoreEntry::describeTimestamps(), StoreEntry::getMD5Text(), StoreEntry::locks(), StoreEntry::mem_obj, StoreEntry::refcount, MemObject::stat(), storeEntryFlags(), storePendingNClients(), StoreEntry::swap_dirn, and StoreEntry::swap_filen.
Referenced by statObjects().
◆ statUtilization()
|
static |
Definition at line 126 of file stat.cc.
References NCountHist, NCountHourHist, statAvgDump(), statCountersDump, and storeAppendPrintf().
◆ storeEntryFlags()
const char * storeEntryFlags | ( | const StoreEntry * | entry | ) |
Definition at line 253 of file stat.cc.
References DELAY_SENDING, EBIT_TEST, ENTRY_ABORTED, ENTRY_BAD_LENGTH, ENTRY_DISPATCHED, ENTRY_FWD_HDR_WAIT, ENTRY_NEGCACHED, ENTRY_REVALIDATE_ALWAYS, ENTRY_REVALIDATE_STALE, ENTRY_SPECIAL, ENTRY_VALIDATED, StoreEntry::flags, int, KEY_PRIVATE, LOCAL_ARRAY, REFRESH_REQUEST, and RELEASE_REQUEST.
Referenced by StoreEntry::dump(), and statStoreEntry().
Variable Documentation
◆ CountHist
StatCounters CountHist[N_COUNT_HIST] |
Definition at line 116 of file stat.cc.
Referenced by GetAvgStat(), snmpStatGet(), stat5minClientRequests(), statAvgTick(), statByteHitRatio(), statCPUUsage(), statInit(), statPctileSvc(), statRequestHitDiskRatio(), statRequestHitMemoryRatio(), and statRequestHitRatio().
◆ CountHourHist
|
static |
Definition at line 118 of file stat.cc.
Referenced by GetAvgStat(), statAvgTick(), and statInit().
◆ mem_pool_alloc_calls
|
extern |
◆ mem_pool_free_calls
|
extern |
◆ NCountHist
|
static |
Definition at line 117 of file stat.cc.
Referenced by statAvgTick(), and statUtilization().
◆ NCountHourHist
|
static |
Definition at line 119 of file stat.cc.
Referenced by statAvgTick(), and statUtilization().
◆ stat_objects_get
|
static |
Definition at line 88 of file stat.cc.
Referenced by statRegisterWithCacheManager().
◆ stat_vmobjects_get
|
static |
Definition at line 89 of file stat.cc.
Referenced by statRegisterWithCacheManager().
◆ statClientRequests
|
static |
Definition at line 97 of file stat.cc.
Referenced by statRegisterWithCacheManager().
◆ statCountersDump
|
static |
Definition at line 92 of file stat.cc.
Referenced by statDigestBlob(), and statUtilization().
◆ statCountersHistograms
|
static |
Definition at line 96 of file stat.cc.
Referenced by statDigestBlob(), and statRegisterWithCacheManager().
◆ statDigestBlob
|
static |
Definition at line 94 of file stat.cc.
Referenced by statRegisterWithCacheManager().
◆ statObjects
|
static |
Definition at line 91 of file stat.cc.
Referenced by statObjects(), and statObjectsStart().
◆ statOpenfdObj
|
static |
Definition at line 90 of file stat.cc.
Referenced by statRegisterWithCacheManager().
◆ statPeerSelect
|
static |
Definition at line 93 of file stat.cc.
Referenced by statDigestBlob(), and statRegisterWithCacheManager().
◆ statUtilization
|
static |
Definition at line 95 of file stat.cc.
Referenced by statRegisterWithCacheManager().