void DaemonCore::Stats::Reconfig() { int window = param_integer("DCSTATISTICS_WINDOW_SECONDS", -1, -1, INT_MAX); if (window < 0) window = param_integer("STATISTICS_WINDOW_SECONDS", 1200, 1, INT_MAX); int quantum = configured_statistics_window_quantum(); this->RecentWindowQuantum = quantum; this->RecentWindowMax = (window + quantum - 1) / quantum * quantum; this->PublishFlags = 0 | IF_RECENTPUB; char * tmp = param("STATISTICS_TO_PUBLISH"); if (tmp) { this->PublishFlags = generic_stats_ParseConfigString(tmp, "DC", "DAEMONCORE", this->PublishFlags); free(tmp); } SetWindowSize(this->RecentWindowMax); std::string strWhitelist; if (param(strWhitelist, "STATISTICS_TO_PUBLISH_LIST")) { this->Pool.SetVerbosities(strWhitelist.c_str(), this->PublishFlags, true); } std::string timespans; param(timespans,"DCSTATISTICS_TIMESPANS"); std::string timespans_err; if( !ParseEMAHorizonConfiguration(timespans.c_str(),ema_config,timespans_err) ) { EXCEPT("Error in DCSTATISTICS_TIMESPANS=%s: %s",timespans.c_str(),timespans_err.c_str()); } this->Commands.ConfigureEMAHorizons(ema_config); }
void ScheddStatistics::Reconfig() { int quantum = param_integer("STATISTICS_WINDOW_QUANTUM_SCHEDULER", INT_MAX, 1, INT_MAX); if (quantum >= INT_MAX) quantum = param_integer("STATISTICS_WINDOW_QUANTUM_SCHEDD", INT_MAX, 1, INT_MAX); if (quantum >= INT_MAX) quantum = param_integer("STATISTICS_WINDOW_QUANTUM", 4*60, 1, INT_MAX); this->RecentWindowQuantum = quantum; this->RecentWindowMax = param_integer("STATISTICS_WINDOW_SECONDS", 1200, quantum, INT_MAX); this->PublishFlags = IF_BASICPUB | IF_RECENTPUB; char * tmp = param("STATISTICS_TO_PUBLISH"); if (tmp) { this->PublishFlags = generic_stats_ParseConfigString(tmp, "SCHEDD", "SCHEDULER", this->PublishFlags); free(tmp); } SetWindowSize(this->RecentWindowMax); //stats_histogram_sizes::init_sizes_from_param("MAX_HIST_SIZES_LEVELS"); //JobSizes.reconfig(); //JobSizesGoodput.reconfig(); //JobSizesBadput.reconfig(); }
void ScheddStatistics::Publish(ClassAd & ad, const char * config) const { int flags = this->PublishFlags; if (config && config[0]) { flags = generic_stats_ParseConfigString(config, "SCHEDD", "SCHEDULER", IF_BASICPUB | IF_RECENTPUB); } this->Publish(ad, flags); }
void DaemonCore::Stats::Publish(ClassAd & ad, const char * config) const { int flags = this->PublishFlags; if (config && config[0]) { flags = generic_stats_ParseConfigString(config, "DC", "DAEMONCORE", 0 | IF_RECENTPUB); } this->Publish(ad, flags); }
void TransferQueueManager::publish(ClassAd *ad, char const *publish_config) { int publish_flags = m_publish_flags; if (publish_config && publish_config[0]) { publish_flags = generic_stats_ParseConfigString(publish_config, "TRANSFER", "TRANSFER", publish_flags); } publish(ad,publish_flags); }
void StarterStatistics::Reconfig() { int quantum = param_integer("STATISTICS_WINDOW_QUANTUM_STARTER", INT_MAX, 1, INT_MAX); if (quantum >= INT_MAX) quantum = param_integer("STATISTICS_WINDOW_QUANTUM", 4*60, 1, INT_MAX); this->RecentWindowQuantum = quantum; int window = param_integer("STATISTICS_WINDOW_SECONDS_STARTER", INT_MAX, 1, INT_MAX); if (window >= INT_MAX) window = param_integer("STATISTICS_WINDOW_SECONDS", 1200, quantum, INT_MAX); this->RecentWindowMax = window; this->RecentWindowMax = window; Pool.SetRecentMax(window, this->RecentWindowQuantum); this->PublishFlags = IF_BASICPUB | IF_RECENTPUB; char* tmp = param("STATISTICS_TO_PUBLISH"); if (tmp) { this->PublishFlags = generic_stats_ParseConfigString(tmp, "STARTER", "_no_alternate_name_", this->PublishFlags); free(tmp); } }
void TransferQueueManager::InitAndReconfig() { m_max_downloads = param_integer("MAX_CONCURRENT_DOWNLOADS",10,0); m_max_uploads = param_integer("MAX_CONCURRENT_UPLOADS",10,0); m_default_max_queue_age = param_integer("MAX_TRANSFER_QUEUE_AGE",3600*2,0); parseThrottleConfig("FILE_TRANSFER_DISK_LOAD_THROTTLE",m_throttle_disk_load,m_disk_load_low_throttle,m_disk_load_high_throttle,m_disk_throttle_short_horizon,m_disk_throttle_long_horizon,m_throttle_disk_load_increment_wait); if( m_throttle_disk_load ) { m_stat_pool.AddProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_LOW,&m_disk_throttle_low_stat,NULL,IF_BASICPUB|m_disk_throttle_low_stat.PubValue); m_stat_pool.AddProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_HIGH,&m_disk_throttle_high_stat,NULL,IF_BASICPUB|m_disk_throttle_high_stat.PubValue); m_stat_pool.AddProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_LIMIT,&m_disk_throttle_limit_stat,NULL,IF_BASICPUB|m_disk_throttle_limit_stat.PubValue); m_stat_pool.AddProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_EXCESS,&m_disk_throttle_excess,NULL,IF_BASICPUB|m_disk_throttle_excess.PubDefault); m_stat_pool.AddProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_SHORTFALL,&m_disk_throttle_shortfall,NULL,IF_BASICPUB|m_disk_throttle_shortfall.PubDefault); } else { m_stat_pool.RemoveProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_LOW); m_stat_pool.RemoveProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_HIGH); m_stat_pool.RemoveProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_LIMIT); m_stat_pool.RemoveProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_EXCESS); m_stat_pool.RemoveProbe(ATTR_FILE_TRANSFER_DISK_THROTTLE_SHORTFALL); } m_update_iostats_interval = param_integer("TRANSFER_IO_REPORT_INTERVAL",10,0); if( m_update_iostats_interval != 0 ) { if( m_update_iostats_timer != -1 ) { ASSERT( daemonCore->Reset_Timer_Period(m_update_iostats_timer,m_update_iostats_interval) == 0 ); } else { m_update_iostats_timer = daemonCore->Register_Timer( m_update_iostats_interval, m_update_iostats_interval, (TimerHandlercpp)&TransferQueueManager::UpdateIOStats, "UpdateIOStats",this); ASSERT( m_update_iostats_timer != -1 ); } } m_publish_flags = IF_BASICPUB; std::string publish_config; if( param(publish_config,"STATISTICS_TO_PUBLISH") ) { m_publish_flags = generic_stats_ParseConfigString(publish_config.c_str(), "TRANSFER", "TRANSFER", m_publish_flags); } std::string iostat_timespans; param(iostat_timespans,"TRANSFER_IO_REPORT_TIMESPANS"); std::string iostat_timespans_err; if( !ParseEMAHorizonConfiguration(iostat_timespans.c_str(),ema_config,iostat_timespans_err) ) { EXCEPT("Error in TRANSFER_IO_REPORT_TIMESPANS=%s: %s",iostat_timespans.c_str(),iostat_timespans_err.c_str()); } m_iostats.ConfigureEMAHorizons(ema_config); if( m_throttle_disk_load ) { if( !m_iostats.file_read.HasEMAHorizonNamed(m_disk_throttle_short_horizon.c_str()) ) { std::string shortest_horizon = m_iostats.file_read.ShortestHorizonEMAName(); dprintf(D_ALWAYS,"WARNING: FILE_TRANSFER_DISK_LOAD_THROTTLE_SHORT_HORIZON=%s does not match a timespan listed in TRANSFER_IO_REPORT_TIMESPANS=%s; using %s instead\n", m_disk_throttle_short_horizon.c_str(), iostat_timespans.c_str(), shortest_horizon.c_str()); m_disk_throttle_short_horizon = shortest_horizon; } if( !m_iostats.file_read.HasEMAHorizonNamed(m_disk_throttle_long_horizon.c_str()) ) { std::string shortest_horizon = m_iostats.file_read.ShortestHorizonEMAName(); dprintf(D_ALWAYS,"WARNING: FILE_TRANSFER_DISK_LOAD_THROTTLE_LONG_HORIZON=%s does not match a timespan listed in TRANSFER_IO_REPORT_TIMESPANS=%s; using %s instead\n", m_disk_throttle_long_horizon.c_str(), iostat_timespans.c_str(), shortest_horizon.c_str()); m_disk_throttle_long_horizon = shortest_horizon; } } for( QueueUserMap::iterator user_itr = m_queue_users.begin(); user_itr != m_queue_users.end(); ++user_itr ) { user_itr->second.iostats.ConfigureEMAHorizons(ema_config); } m_disk_throttle_excess.ConfigureEMAHorizons(ema_config); m_disk_throttle_shortfall.ConfigureEMAHorizons(ema_config); }