stat.cc File Reference
#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"
Include dependency graph for stat.cc:

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 *)
 

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)
 
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)
 

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

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

Definition at line 863 of file stat.cc.

Typedef Documentation

◆ STOBJFLT

typedef int STOBJFLT(const StoreEntry *)

Definition at line 66 of file stat.cc.

Function Documentation

◆ describeStatuses()

static const char * describeStatuses ( const StoreEntry entry)
static

◆ DumpAvgStat()

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

◆ 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()

◆ 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 
)

◆ GetAvgStat()

◆ 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()

◆ GetIoStats()

void GetIoStats ( Mgr::IoActionData stats)

◆ GetServiceTimesStats()

◆ snmpStatGet()

StatCounters * snmpStatGet ( int  minutes)

Definition at line 1681 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 382 of file stat.cc.

References statObjectsStart().

◆ stat_vmobjects_get()

static void stat_vmobjects_get ( StoreEntry sentry)
static

Definition at line 394 of file stat.cc.

References statObjectsStart(), and statObjectsVmFilter().

◆ statAvgDump()

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

Definition at line 856 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 1348 of file stat.cc.

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

◆ statCountersHistograms()

◆ statCountersInit()

static void statCountersInit ( StatCounters C)
static

Definition at line 1240 of file stat.cc.

References assert, C, and statCountersInitSpecial().

Referenced by statInit().

◆ statCountersInitSpecial()

static void statCountersInitSpecial ( StatCounters C)
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()

static double statCPUUsage ( int  minutes)
static

Definition at line 1694 of file stat.cc.

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

Referenced by GetInfo().

◆ statDigestBlob()

static void statDigestBlob ( StoreEntry sentry)
static

◆ statInit()

◆ statObjects()

◆ statObjectsOpenfdFilter()

static int statObjectsOpenfdFilter ( const StoreEntry e)
static

Definition at line 400 of file stat.cc.

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

Referenced by statOpenfdObj().

◆ statObjectsStart()

◆ statObjectsVmFilter()

static int statObjectsVmFilter ( const StoreEntry e)
static

Definition at line 388 of file stat.cc.

References StoreEntry::mem_obj.

Referenced by stat_vmobjects_get().

◆ statOpenfdObj()

static void statOpenfdObj ( StoreEntry sentry)
static

Definition at line 412 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 126 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 118 of file stat.cc.

Referenced by GetAvgStat(), statAvgTick(), 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 117 of file stat.cc.

Referenced by statAvgTick(), and statUtilization().

◆ NCountHourHist

int NCountHourHist = 0
static

Definition at line 119 of file stat.cc.

Referenced by statAvgTick(), and statUtilization().

◆ stat_objects_get

OBJH stat_objects_get
static

Definition at line 88 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ stat_vmobjects_get

OBJH stat_vmobjects_get
static

Definition at line 89 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ statClientRequests

OBJH statClientRequests
static

Definition at line 97 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ statCountersDump

OBJH statCountersDump
static

Definition at line 92 of file stat.cc.

Referenced by statDigestBlob(), and statUtilization().

◆ statCountersHistograms

OBJH statCountersHistograms
static

Definition at line 96 of file stat.cc.

Referenced by statDigestBlob(), and statRegisterWithCacheManager().

◆ statDigestBlob

OBJH statDigestBlob
static

Definition at line 94 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ statObjects

EVH statObjects
static

Definition at line 91 of file stat.cc.

Referenced by statObjects(), and statObjectsStart().

◆ statOpenfdObj

OBJH statOpenfdObj
static

Definition at line 90 of file stat.cc.

Referenced by statRegisterWithCacheManager().

◆ statPeerSelect

OBJH statPeerSelect
static

Definition at line 93 of file stat.cc.

Referenced by statDigestBlob(), and statRegisterWithCacheManager().

◆ statUtilization

OBJH statUtilization
static

Definition at line 95 of file stat.cc.

Referenced by statRegisterWithCacheManager().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors