Skip to content
Snippets Groups Projects
Commit f33643cb authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Distinguish high-load from probation from good-before.

parent 7529d82f
Branches
No related tags found
Loading
...@@ -110,9 +110,15 @@ namespace ATxCommon.Monitoring ...@@ -110,9 +110,15 @@ namespace ATxCommon.Monitoring
_loadReadings[3] = _cpuCounter.NextValue(); _loadReadings[3] = _cpuCounter.NextValue();
_load = _loadReadings.Average(); _load = _loadReadings.Average();
if (_loadReadings[3] > _limit) { if (_loadReadings[3] > _limit) {
Log.Debug("CPU load ({0}) violating limit ({1})!", _loadReadings[3], _limit); if (_behaving > _probation) {
_behaving = 0; // this means the load was considered as "low" before
// TODO: fire callback for violating load limit // TODO: fire callback for violating load limit
Log.Debug("CPU load ({0}) violating limit ({1})!", _loadReadings[3], _limit);
} else if (_behaving > 0) {
// this means we were still in probation, so no need to trigger again...
Log.Debug("Resetting behaving counter to 0 (was {0}).", _behaving);
}
_behaving = 0;
} else { } else {
_behaving++; _behaving++;
if (_behaving == _probation) { if (_behaving == _probation) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment