/** * TODO(skonefal): SerenityConfig should have const methods inside. * Currently, it cannot be passed as const. */ explicit SeniorityStrategy(SerenityConfig _config) : RevocationStrategy(Tag(QOS_CONTROLLER, NAME)) { initialize(); if (_config.hasKey(STARTING_SEVERITY_KEY)) { severity = _config.getD(STARTING_SEVERITY_KEY); } }
explicit SeniorityStrategy(const SerenityConfig& _config) : RevocationStrategy(Tag(QOS_CONTROLLER, "SeniorityStrategy")), cooldownCounter(None()), estimatorDisabled(false) { SerenityConfig config = SeniorityConfig(_config); this->cfgCooldownTime = config.getU64(decider::CONTENTION_COOLDOWN); this->cfgDefaultSeverity = config.getD(decider::STARTING_SEVERITY); }
explicit CpuContentionStrategy( const SerenityConfig& _config, const lambda::function<usage::GetterFunction>& _cpuUsageGetFunction) : RevocationStrategy(Tag(QOS_CONTROLLER, "CpuContentionStrategy")), cpuUsageGetFunction(_cpuUsageGetFunction), cooldownCounter(None()), estimatorDisabled(false) { SerenityConfig config = CpuContentionStrategyConfig(_config); this->cfgCooldownTime = config.getU64(strategy::CONTENTION_COOLDOWN); this->cfgDefaultSeverity = config.getD(strategy::DEFAULT_CPU_SEVERITY); }
OverloadDetector( Consumer<Contentions>* _consumer, const lambda::function<usage::GetterFunction>& _cpuUsageGetFunction, SerenityConfig _conf, const Tag& _tag = Tag(QOS_CONTROLLER, NAME)) : tag(_tag), cpuUsageGetFunction(_cpuUsageGetFunction), Producer<Contentions>(_consumer) { SerenityConfig config = OverloadDetectorConfig(_conf); this->cfgUtilizationThreshold = config.getD(detector::THRESHOLD); }