Esempio n. 1
0
void DefragStats::Init()
{
    Clear();
    // default window size to 1 quantum, we may set it to something else later.
    this->RecentWindowMax = this->RecentWindowQuantum;

    // insert static items into the stats pool so we can use the pool
    // to Advance and Clear.  these items also publish the overall value
    STATS_POOL_ADD_VAL_PUB_RECENT(Pool, "", DrainSuccesses, IF_BASICPUB);
    STATS_POOL_ADD_VAL_PUB_RECENT(Pool, "", DrainFailures, IF_BASICPUB);
    STATS_POOL_ADD_VAL(Pool, "", MachinesDraining, IF_BASICPUB);
    STATS_POOL_PUB_PEAK(Pool, "", MachinesDraining, IF_BASICPUB);
    STATS_POOL_ADD_VAL(Pool, "", WholeMachines, IF_BASICPUB);
    STATS_POOL_PUB_PEAK(Pool, "", WholeMachines, IF_BASICPUB);
    STATS_POOL_ADD_VAL(Pool, "", AvgDrainingBadput, IF_BASICPUB);
    STATS_POOL_ADD_VAL(Pool, "", AvgDrainingUnclaimed, IF_BASICPUB);
    STATS_POOL_ADD_VAL(Pool, "", MeanDrainedArrival, IF_BASICPUB);
    STATS_POOL_ADD_VAL(Pool, "", MeanDrainedArrivalSD, IF_BASICPUB);
    STATS_POOL_ADD_VAL(Pool, "", DrainedMachines, IF_BASICPUB);
}
Esempio n. 2
0
// this is for first time initialization before calling SetWindowSize,
// use the Clear() method to reset stats after the window size has been set.
//
void DaemonCore::Stats::Init(bool enable)
{ 
   Clear();
   this->enabled = enable;
   this->RecentWindowQuantum = configured_statistics_window_quantum();
   this->RecentWindowMax = this->RecentWindowQuantum; 
   this->PublishFlags    = -1;
   if ( ! enable) return;

   // insert static items into the stats pool so we can use the pool 
   // to Advance and Clear.  these items also publish the overall value
   // and the Recent value
   //
   DC_STATS_ADD_RECENT(Pool, SelectWaittime,  IF_BASICPUB);
   DC_STATS_ADD_RECENT(Pool, SignalRuntime,   IF_BASICPUB);
   DC_STATS_ADD_RECENT(Pool, TimerRuntime,    IF_BASICPUB);
   DC_STATS_ADD_RECENT(Pool, SocketRuntime,   IF_BASICPUB);
   DC_STATS_ADD_RECENT(Pool, PipeRuntime,     IF_BASICPUB);
   DC_STATS_ADD_RECENT(Pool, Signals,       IF_BASICPUB);
   DC_STATS_ADD_RECENT(Pool, TimersFired,   IF_BASICPUB);
   DC_STATS_ADD_RECENT(Pool, SockMessages,  IF_BASICPUB);
   DC_STATS_ADD_RECENT(Pool, PipeMessages,  IF_BASICPUB);
   //DC_STATS_ADD_RECENT(Pool, SockBytes,     IF_BASICPUB);
   //DC_STATS_ADD_RECENT(Pool, PipeBytes,     IF_BASICPUB);
   DC_STATS_ADD_RECENT(Pool, DebugOuts,     IF_VERBOSEPUB);
   DC_STATS_ADD_RECENT(Pool, PumpCycle,     IF_VERBOSEPUB);
   STATS_POOL_ADD_VAL(Pool, "DC", UdpQueueDepth,  IF_BASICPUB);
   STATS_POOL_PUB_PEAK(Pool, "DC", UdpQueueDepth,  IF_BASICPUB);
   DC_STATS_ADD_DEF(Pool, Commands, IF_BASICPUB);

   // insert entries that are stored in helper modules
   //
   extern stats_entry_probe<double> condor_fsync_runtime;
   Pool.AddProbe("DCfsync", &condor_fsync_runtime, "DCfsync", IF_VERBOSEPUB | IF_RT_SUM);

#if 1
   //PRAGMA_REMIND("temporarily!! publish recent windowed values for DNS lookup runtime...")
   extern stats_entry_recent<Probe> getaddrinfo_runtime; // count & runtime of all lookups, success and fail
   extern stats_entry_recent<Probe> getaddrinfo_fast_runtime; // count & runtime of successful lookups that were faster than getaddrinfo_slow_limit
   extern stats_entry_recent<Probe> getaddrinfo_slow_runtime; // count & runtime of successful lookups that were slower than getaddrinfo_slow_limit
   extern stats_entry_recent<Probe> getaddrinfo_fail_runtime; // count & runtime of failed lookups
   //extern double getaddrinfo_slow_limit;
   //#define GAI_TAG "DNSLookup"
   #define GAI_TAG "NameResolve"
   const int pub_flags = ProbeDetailMode_RT_SUM | stats_entry_recent<Probe>::PubValueAndRecent;
   Pool.AddProbe("DC" GAI_TAG,        &getaddrinfo_runtime,      NULL, IF_VERBOSEPUB | pub_flags);
   Pool.AddProbe("DC" GAI_TAG "Fast", &getaddrinfo_fast_runtime, NULL, IF_VERBOSEPUB | pub_flags);
   Pool.AddProbe("DC" GAI_TAG "Slow", &getaddrinfo_slow_runtime, NULL, IF_VERBOSEPUB | pub_flags);
   Pool.AddProbe("DC" GAI_TAG "Fail", &getaddrinfo_fail_runtime, NULL, IF_VERBOSEPUB | pub_flags);
   #undef GAI_TAG
#else
   extern stats_entry_probe<double> getaddrinfo_runtime; // count & runtime of all lookups, success and fail
   extern stats_entry_probe<double> getaddrinfo_fast_runtime; // count & runtime of successful lookups that were faster than getaddrinfo_slow_limit
   extern stats_entry_probe<double> getaddrinfo_slow_runtime; // count & runtime of successful lookups that were slower than getaddrinfo_slow_limit
   extern stats_entry_probe<double> getaddrinfo_fail_runtime; // count & runtime of failed lookups
   //extern double getaddrinfo_slow_limit;
   //#define GAI_TAG "DNSLookup"
   #define GAI_TAG "NameResolve"
   Pool.AddProbe("DC" GAI_TAG,        &getaddrinfo_runtime,      "DC" GAI_TAG,        IF_VERBOSEPUB | IF_RT_SUM);
   Pool.AddProbe("DC" GAI_TAG "Fast", &getaddrinfo_fast_runtime, "DC" GAI_TAG "Fast", IF_VERBOSEPUB | IF_RT_SUM);
   Pool.AddProbe("DC" GAI_TAG "Slow", &getaddrinfo_slow_runtime, "DC" GAI_TAG "Slow", IF_VERBOSEPUB | IF_RT_SUM);
   Pool.AddProbe("DC" GAI_TAG "Fail", &getaddrinfo_fail_runtime, "DC" GAI_TAG "Fail", IF_VERBOSEPUB | IF_RT_SUM);
   #undef GAI_TAG
#endif

   // Insert additional publish entries for the XXXDebug values
   //
   DC_STATS_PUB_DEBUG(Pool, SelectWaittime,  IF_BASICPUB);
   DC_STATS_PUB_DEBUG(Pool, SignalRuntime,   IF_BASICPUB);
   DC_STATS_PUB_DEBUG(Pool, TimerRuntime,    IF_BASICPUB);
   DC_STATS_PUB_DEBUG(Pool, SocketRuntime,   IF_BASICPUB);
   DC_STATS_PUB_DEBUG(Pool, PipeRuntime,     IF_BASICPUB);
   DC_STATS_PUB_DEBUG(Pool, Signals,       IF_BASICPUB);
   DC_STATS_PUB_DEBUG(Pool, TimersFired,   IF_BASICPUB);
   DC_STATS_PUB_DEBUG(Pool, SockMessages,  IF_BASICPUB);
   DC_STATS_PUB_DEBUG(Pool, PipeMessages,  IF_BASICPUB);
   //DC_STATS_PUB_DEBUG(Pool, SockBytes,     IF_BASICPUB);
   //DC_STATS_PUB_DEBUG(Pool, PipeBytes,     IF_BASICPUB);
   DC_STATS_PUB_DEBUG(Pool, DebugOuts,     IF_VERBOSEPUB);
   DC_STATS_PUB_DEBUG(Pool, PumpCycle,     IF_VERBOSEPUB);


   // clear all counters we just added to the pool
   Pool.Clear();
}