21 #include <glog/logging.h> 45 typedef std::set<folly::SocketAddress, AddressOnlyCompare>
AddressSet;
90 const uint64_t acceptPauseOnAcceptorQueueSize) {
102 const uint64_t acceptResumeOnAcceptorQueueSize) {
void setCpuUsageExceedWindowSize(const uint64_t size)
LoadShedConfiguration()=default
void setLogicalCpuCoreQuorum(uint64_t quorum)
void setMaxConnections(uint64_t maxConns)
std::chrono::milliseconds getLoadUpdatePeriod() const
uint64_t getCpuUsageExceedWindowSize() const
void checkIsSane(const SysParams &sysParams) const
bool loadSheddingEnabled_
std::chrono::milliseconds period_
bool getLoadSheddingEnabled() const
void setWhitelistNetworks(const NetworkSet &networks)
double getMinCpuIdle() const
double getMaxCpuUsage() const
uint64_t getMinFreeMem() const
void setMinFreeMem(uint64_t min)
~LoadShedConfiguration()=default
void setMaxActiveConnections(uint64_t maxActiveConns)
uint64_t getLogicalCpuCoreQuorum() const
uint64_t getMaxConnections() const
void setWhitelistAddrs(const AddressSet &addrs)
bool isWhitelisted(const folly::SocketAddress &addr) const
const NetworkSet & getWhitelistNetworks() const
constexpr auto size(C const &c) -> decltype(c.size())
uint64_t getMaxActiveConnections() const
void setMinCpuIdle(double min)
std::set< folly::SocketAddress, AddressOnlyCompare > AddressSet
void setMaxTcpMemUsage(double max)
double getMaxMemUsage() const
const folly::IPAddress & getIPAddress() const
void setLoadUpdatePeriod(std::chrono::milliseconds period)
std::set< NetworkAddress > NetworkSet
const AddressSet & getWhitelistAddrs() const
double getMaxTcpMemUsage() const
uint64_t getAcceptPauseOnAcceptorQueueSize() const
void setMinFreeTcpMemPct(double min)
uint64_t acceptResumeOnAcceptorQueueSize_
void setMaxCpuUsage(double max)
uint64_t cpuUsageExceedWindowSize_
void setAcceptPauseOnAcceptorQueueSize(const uint64_t acceptPauseOnAcceptorQueueSize)
void setLoadSheddingEnabled(bool enabled)
AddressSet whitelistAddrs_
void setMaxMemUsage(double max)
bool operator()(const folly::SocketAddress &addr1, const folly::SocketAddress &addr2) const
void addWhitelistAddr(folly::StringPiece)
ThreadPoolListHook * addr
uint64_t acceptPauseOnAcceptorQueueSize_
void setAcceptResumeOnAcceptorQueueSize(const uint64_t acceptResumeOnAcceptorQueueSize)
uint64_t getAcceptResumeOnAcceptorQueueSize() const
double getMinFreeTcpMemPct() const
NetworkSet whitelistNetworks_
uint64_t maxActiveConnections_
uint64_t logicalCpuCoreQuorum_