NCBI C++ ToolKit
Macros | Typedefs | Functions | Variables
nc_stat.cpp File Reference
#include "nc_pch.hpp"
#include <corelib/request_ctx.hpp>
#include "netcached.hpp"
#include "nc_stat.hpp"
#include "distribution_conf.hpp"
#include "nc_storage.hpp"
#include "logging.hpp"
#include <set>
+ Include dependency graph for nc_stat.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define USE_DETAILED_SLOT_STAT   1
 

Typedefs

typedef map< Uint8, CSrvTimeTSyncTimes
 
typedef map< Uint8, map< Uint2, CSrvTime > > TDetailedSyncTimes
 

Functions

static void s_InitPeriodsCollected (void)
 
static void s_CheckTZChange (void)
 
static void s_SetCurMonthSize (void)
 
static CNCStats_Stat (void)
 
static unsigned int s_SizeIndex (Uint8 size)
 
static void s_ShiftStats (Uint1 idx)
 
static void s_CollectCurStats (void)
 

Variables

static const Uint1 kCntStatPeriods = 10
 
static const char *const kStatPeriodName [kCntStatPeriods] = {"5s", "1min", "5min", "1h", "1d", "1w", "1mon", "3mon", "1y", "life"}
 
static Uint1 kCollectPeriodsCnt [kCntStatPeriods] = {0, 12, 5, 12, 24, 7, 31, 3, 4, 0}
 
static const Uint1 kMinStatPeriod = 5
 
static const Uint1 kDayPeriodIdx = 4
 
static const Uint1 kMonthPeriodIdx = 6
 
static const Uint1 kLifePeriodIdx = 9
 
static CNCStats_ThreadStat = NULL
 
static CNCStat ** s_CurPeriodStat = NULL
 
static CNCStat ** s_PrevPeriodStat = NULL
 
static CStatRotators_Rotator = NULL
 
static CMiniMutex s_RotateLock
 
static Uint1 s_PeriodsCollected [kCntStatPeriods] = {0}
 
static int s_LastRotateSecs = 0
 
static CMiniMutex s_CommonStatLock
 
static set< Uint8s_SyncSrv
 
static set< Uint8s_UnknownSrv
 
static TSyncTimes s_SyncSucceeded
 
static TSyncTimes s_SyncFailed
 
static TDetailedSyncTimes s_SyncPeriodic
 

Macro Definition Documentation

◆ USE_DETAILED_SLOT_STAT

#define USE_DETAILED_SLOT_STAT   1

Definition at line 70 of file nc_stat.cpp.

Typedef Documentation

◆ TDetailedSyncTimes

Definition at line 72 of file nc_stat.cpp.

◆ TSyncTimes

Definition at line 66 of file nc_stat.cpp.

Function Documentation

◆ s_CheckTZChange()

static void s_CheckTZChange ( void  )
static

Definition at line 100 of file nc_stat.cpp.

References CSrvTime::CurSecs(), kDayPeriodIdx, s_PeriodsCollected, t, and CSrvTime::TZAdjustment().

Referenced by s_CollectCurStats().

◆ s_CollectCurStats()

static void s_CollectCurStats ( void  )
static

◆ s_InitPeriodsCollected()

static void s_InitPeriodsCollected ( void  )
static

◆ s_SetCurMonthSize()

static void s_SetCurMonthSize ( void  )
static

◆ s_ShiftStats()

static void s_ShiftStats ( Uint1  idx)
static

◆ s_SizeIndex()

static unsigned int s_SizeIndex ( Uint8  size)
static

◆ s_Stat()

static CNCStat* s_Stat ( void  )
inlinestatic

Variable Documentation

◆ kCntStatPeriods

const Uint1 kCntStatPeriods = 10
static

◆ kCollectPeriodsCnt

Uint1 kCollectPeriodsCnt[kCntStatPeriods] = {0, 12, 5, 12, 24, 7, 31, 3, 4, 0}
static

Definition at line 47 of file nc_stat.cpp.

Referenced by s_CollectCurStats(), and s_SetCurMonthSize().

◆ kDayPeriodIdx

const Uint1 kDayPeriodIdx = 4
static

Definition at line 50 of file nc_stat.cpp.

Referenced by s_CheckTZChange(), and s_CollectCurStats().

◆ kLifePeriodIdx

const Uint1 kLifePeriodIdx = 9
static

Definition at line 52 of file nc_stat.cpp.

Referenced by s_CollectCurStats().

◆ kMinStatPeriod

const Uint1 kMinStatPeriod = 5
static

◆ kMonthPeriodIdx

const Uint1 kMonthPeriodIdx = 6
static

Definition at line 51 of file nc_stat.cpp.

Referenced by s_CollectCurStats(), and s_SetCurMonthSize().

◆ kStatPeriodName

const char* const kStatPeriodName[kCntStatPeriods] = {"5s", "1min", "5min", "1h", "1d", "1w", "1mon", "3mon", "1y", "life"}
static

◆ s_CommonStatLock

CMiniMutex s_CommonStatLock
static

◆ s_CurPeriodStat

CNCStat** s_CurPeriodStat = NULL
static

◆ s_LastRotateSecs

int s_LastRotateSecs = 0
static

Definition at line 61 of file nc_stat.cpp.

Referenced by CStatRotator::ExecuteSlice(), and s_InitPeriodsCollected().

◆ s_PeriodsCollected

Uint1 s_PeriodsCollected[kCntStatPeriods] = {0}
static

Definition at line 60 of file nc_stat.cpp.

Referenced by s_CheckTZChange(), s_CollectCurStats(), and s_InitPeriodsCollected().

◆ s_PrevPeriodStat

CNCStat** s_PrevPeriodStat = NULL
static

Definition at line 57 of file nc_stat.cpp.

Referenced by CNCStat::GetStat(), CNCStat::Initialize(), and s_ShiftStats().

◆ s_RotateLock

CMiniMutex s_RotateLock
static

Definition at line 59 of file nc_stat.cpp.

Referenced by CNCStat::GetCntRunningCmds(), CNCStat::GetStat(), and s_ShiftStats().

◆ s_Rotator

CStatRotator* s_Rotator = NULL
static

Definition at line 58 of file nc_stat.cpp.

Referenced by CNCStat::Initialize().

◆ s_SyncFailed

TSyncTimes s_SyncFailed
static

Definition at line 68 of file nc_stat.cpp.

Referenced by CNCStat::InitialSyncDone(), and CNCStat::PrintToSocket().

◆ s_SyncPeriodic

TDetailedSyncTimes s_SyncPeriodic
static

Definition at line 73 of file nc_stat.cpp.

Referenced by CNCStat::PeerSyncFinished(), and CNCStat::PrintToSocket().

◆ s_SyncSrv

set<Uint8> s_SyncSrv
static

Definition at line 64 of file nc_stat.cpp.

Referenced by CNCStat::AddSyncServer(), and CNCStat::PrintToSocket().

◆ s_SyncSucceeded

TSyncTimes s_SyncSucceeded
static

Definition at line 67 of file nc_stat.cpp.

Referenced by CNCStat::InitialSyncDone(), and CNCStat::PrintToSocket().

◆ s_ThreadStat

CNCStat* s_ThreadStat = NULL
static

◆ s_UnknownSrv

set<Uint8> s_UnknownSrv
static

Definition at line 65 of file nc_stat.cpp.

Referenced by CNCStat::AddUnknownServer().

Modified on Wed Apr 24 14:12:37 2024 by modify_doxy.py rev. 669887