stat.cc File Reference
#include "squid.h"
#include "CacheDigest.h"
#include "CachePeer.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_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 "SquidTime.h"
#include "stat.h"
#include "StatCounters.h"
#include "Store.h"
#include "store_digest.h"
#include "StoreClient.h"
#include "tools.h"
#include "util.h"
#include "auth/UserRequest.h"
#include "DelayId.h"
#include "ssl/support.h"
#include "comm.h"
#include "StoreSearch.h"
Include dependency graph for stat.cc:

Go to the source code of this file.

Classes

class  StatObjectsState
 

Macros

#define DEBUG_OPENFD   1
 
#define XAVG(X)   (dt ? (double) (f->X - l->X) / dt : 0.0)
 

Typedefs

typedef int STOBJFLT(const StoreEntry *)
 

Functions

static const char * describeStatuses (const StoreEntry *)
 
static void statAvgTick (void *notused)
 
static void statAvgDump (StoreEntry *, int minutes, int hours)
 
static double statPctileSvc (double, int, int)
 
static void statStoreEntry (MemBuf *mb, StoreEntry *e)
 
static double statCPUUsage (int minutes)
 
void GetAvgStat (Mgr::IntervalActionData &stats, int minutes, int hours)
 
void DumpAvgStat (Mgr::IntervalActionData &stats, StoreEntry *sentry)
 
void GetInfo (Mgr::InfoActionData &stats)
 
void DumpInfo (Mgr::InfoActionData &stats, StoreEntry *sentry)
 
void DumpMallocStatistics (StoreEntry *sentry)
 
void GetCountersStats (Mgr::CountersActionData &stats)
 
void DumpCountersStats (Mgr::CountersActionData &stats, StoreEntry *sentry)
 
void GetServiceTimesStats (Mgr::ServiceTimesActionData &stats)
 
void DumpServiceTimesStats (Mgr::ServiceTimesActionData &stats, StoreEntry *sentry)
 
void GetIoStats (Mgr::IoActionData &stats)
 
void DumpIoStats (Mgr::IoActionData &stats, StoreEntry *sentry)
 
static void statUtilization (StoreEntry *e)
 
const char * storeEntryFlags (const StoreEntry *entry)
 
static void statObjects (void *data)
 
static void statObjectsStart (StoreEntry *sentry, STOBJFLT *filter)
 
static void stat_objects_get (StoreEntry *sentry)
 
static int statObjectsVmFilter (const StoreEntry *e)
 
static void stat_vmobjects_get (StoreEntry *sentry)
 
static int statObjectsOpenfdFilter (const StoreEntry *e)
 
static void statOpenfdObj (StoreEntry *sentry)
 
static void statRegisterWithCacheManager (void)
 
static void statCountersInitSpecial (StatCounters *C)
 
static void statCountersInit (StatCounters *C)
 
void statInit (void)
 
static void statCountersHistograms (StoreEntry *sentry)
 
static void statCountersDump (StoreEntry *sentry)
 
void statFreeMemory (void)
 
static void statPeerSelect (StoreEntry *sentry)
 
static void statDigestBlob (StoreEntry *sentry)
 
StatCounterssnmpStatGet (int minutes)
 
int stat5minClientRequests (void)
 
double statRequestHitRatio (int minutes)
 
double statRequestHitMemoryRatio (int minutes)
 
double statRequestHitDiskRatio (int minutes)
 
double statByteHitRatio (int minutes)
 
static void statClientRequests (StoreEntry *s)
 
int statMemoryAccounted (void)
 

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

◆ DEBUG_OPENFD

#define DEBUG_OPENFD   1

Definition at line 66 of file stat.cc.

◆ XAVG

#define XAVG (   X)    (dt ? (double) (f->X - l->X) / dt : 0.0)

Definition at line 888 of file stat.cc.

Typedef Documentation

◆ STOBJFLT

typedef int STOBJFLT(const StoreEntry *)

Definition at line 68 of file stat.cc.

Function Documentation

◆ describeStatuses()

static const char * describeStatuses ( const StoreEntry entry)
static

◆ DumpAvgStat()

void DumpAvgStat ( Mgr::IntervalActionData stats,
StoreEntry sentry 
)

Definition at line 1026 of file stat.cc.

References Math::doublePercent(), mkrfc1123(), Ping::stats, and storeAppendPrintf().

Referenced by Mgr::IntervalAction::dump(), and statAvgDump().

◆ DumpCountersStats()

void DumpCountersStats ( Mgr::CountersActionData stats,
StoreEntry sentry 
)

Definition at line 1465 of file stat.cc.

References mkrfc1123(), Ping::stats, and storeAppendPrintf().

Referenced by Mgr::CountersAction::dump(), and statCountersDump().

◆ DumpInfo()

◆ DumpIoStats()

void DumpIoStats ( Mgr::IoActionData stats,
StoreEntry sentry 
)

Definition at line 218 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 791 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 
)

◆ GetAvgStat()

◆ GetCountersStats()

void GetCountersStats ( Mgr::CountersActionData stats)

Definition at line 1383 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()

◆ GetIoStats()

void GetIoStats ( Mgr::IoActionData stats)

◆ GetServiceTimesStats()

◆ snmpStatGet()

StatCounters* snmpStatGet ( int  minutes)

Definition at line 1720 of file stat.cc.

References CountHist.

Referenced by snmp_prfProtoFn().

◆ stat5minClientRequests()

int stat5minClientRequests ( void  )

◆ stat_objects_get()

static void stat_objects_get ( StoreEntry sentry)
static

Definition at line 405 of file stat.cc.

References NULL, and statObjectsStart().

◆ stat_vmobjects_get()

static void stat_vmobjects_get ( StoreEntry sentry)
static

Definition at line 417 of file stat.cc.

References statObjectsStart(), and statObjectsVmFilter().

◆ statAvgDump()

static void statAvgDump ( StoreEntry sentry,
int  minutes,
int  hours 
)
static

Definition at line 881 of file stat.cc.

References DumpAvgStat(), GetAvgStat(), and Ping::stats.

Referenced by statDigestBlob(), and statUtilization().

◆ statAvgTick()

◆ statByteHitRatio()

◆ statClientRequests()

◆ statCountersDump()

static void statCountersDump ( StoreEntry sentry)
static

Definition at line 1375 of file stat.cc.

References DumpCountersStats(), GetCountersStats(), and Ping::stats.

◆ statCountersHistograms()

◆ statCountersInit()

static void statCountersInit ( StatCounters C)
static

Definition at line 1267 of file stat.cc.

References assert, C, and statCountersInitSpecial().

Referenced by statInit().

◆ statCountersInitSpecial()

static void statCountersInitSpecial ( StatCounters C)
static

Definition at line 1237 of file stat.cc.

References C, CacheDigestHashFuncCount, INCOMING_DNS_MAX, INCOMING_TCP_MAX, and INCOMING_UDP_MAX.

Referenced by statCountersInit().

◆ statCPUUsage()

static double statCPUUsage ( int  minutes)
static

Definition at line 1733 of file stat.cc.

References assert, CountHist, Math::doublePercent(), N_COUNT_HIST, and tvSubDsec().

Referenced by GetInfo().

◆ statDigestBlob()

static void statDigestBlob ( StoreEntry sentry)
static

◆ statFreeMemory()

void statFreeMemory ( void  )

Definition at line 1601 of file stat.cc.

References CountHist, CountHourHist, N_COUNT_HIST, and N_COUNT_HOUR_HIST.

Referenced by SquidShutdown().

◆ statInit()

◆ statMemoryAccounted()

int statMemoryAccounted ( void  )

Definition at line 1961 of file stat.cc.

References memPoolsTotalAllocated().

Referenced by GetInfo(), and snmp_prfSysFn().

◆ statObjects()

◆ statObjectsOpenfdFilter()

static int statObjectsOpenfdFilter ( const StoreEntry e)
static

Definition at line 424 of file stat.cc.

References StoreEntry::mem_obj, NULL, MemObject::SwapOut::sio, and MemObject::swapout.

Referenced by statOpenfdObj().

◆ statObjectsStart()

◆ statObjectsVmFilter()

static int statObjectsVmFilter ( const StoreEntry e)
static

Definition at line 411 of file stat.cc.

References StoreEntry::mem_obj.

Referenced by stat_vmobjects_get().

◆ statOpenfdObj()

static void statOpenfdObj ( StoreEntry sentry)
static

Definition at line 436 of file stat.cc.

References statObjectsOpenfdFilter(), and statObjectsStart().

◆ statPctileSvc()

◆ statPeerSelect()

◆ statRegisterWithCacheManager()

◆ statRequestHitDiskRatio()

double statRequestHitDiskRatio ( int  minutes)

◆ statRequestHitMemoryRatio()

double statRequestHitMemoryRatio ( int  minutes)

◆ statRequestHitRatio()

double statRequestHitRatio ( int  minutes)

◆ statStoreEntry()

◆ statUtilization()

static void statUtilization ( StoreEntry e)
static

Definition at line 130 of file stat.cc.

References NCountHist, NCountHourHist, statAvgDump(), statCountersDump, and storeAppendPrintf().

◆ storeEntryFlags()

Variable Documentation

◆ CountHist

◆ CountHourHist

StatCounters CountHourHist[N_COUNT_HOUR_HIST]
static

Definition at line 122 of file stat.cc.

Referenced by GetAvgStat(), statAvgTick(), statFreeMemory(), and statInit().

◆ mem_pool_alloc_calls

unsigned int mem_pool_alloc_calls
extern

◆ mem_pool_free_calls

unsigned int mem_pool_free_calls
extern

◆ NCountHist

int NCountHist = 0
static

Definition at line 121 of file stat.cc.

Referenced by statAvgTick(), and statUtilization().

◆ NCountHourHist

int NCountHourHist = 0
static

Definition at line 123 of file stat.cc.

Referenced by statAvgTick(), and statUtilization().

◆ stat_objects_get

OBJH stat_objects_get
static

Definition at line 90 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ stat_vmobjects_get

OBJH stat_vmobjects_get
static

Definition at line 91 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ statClientRequests

OBJH statClientRequests
static

Definition at line 101 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ statCountersDump

OBJH statCountersDump
static

Definition at line 96 of file stat.cc.

Referenced by statDigestBlob(), and statUtilization().

◆ statCountersHistograms

OBJH statCountersHistograms
static

Definition at line 100 of file stat.cc.

Referenced by statDigestBlob(), and statRegisterWithCacheManager().

◆ statDigestBlob

OBJH statDigestBlob
static

Definition at line 98 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ statObjects

EVH statObjects
static

Definition at line 95 of file stat.cc.

Referenced by statObjects(), and statObjectsStart().

◆ statOpenfdObj

OBJH statOpenfdObj
static

Definition at line 93 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ statPeerSelect

OBJH statPeerSelect
static

Definition at line 97 of file stat.cc.

Referenced by statDigestBlob(), and statRegisterWithCacheManager().

◆ statUtilization

OBJH statUtilization
static

Definition at line 99 of file stat.cc.

Referenced by statRegisterWithCacheManager().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors