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

Logging changes

Refers to #36
parent a9d21c4a
No related branches found
No related tags found
No related merge requests found
......@@ -113,7 +113,7 @@ namespace ATxCommon.Monitoring
Log.Debug("Initializing CPU monitoring...");
try {
_cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total");
Log.Debug("CPU monitoring initializing PerformanceCounter (takes 1s)...");
Log.Debug("CPU monitoring initializing PerformanceCounter (takes one second)...");
_cpuCounter.NextValue();
Thread.Sleep(1000);
Log.Debug("CPU monitoring current load: {0:0.0}", _cpuCounter.NextValue());
......@@ -144,16 +144,16 @@ namespace ATxCommon.Monitoring
if (_behaving > _probation) {
// this means the load was considered as "low" before, so raise an event:
OnLoadAboveLimit();
Log.Debug("CPU load ({0:0.0}) violating limit ({1})!", _loadReadings[3], _limit);
Log.Trace("CPU load ({0:0.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);
Log.Trace("Resetting behaving counter to 0 (was {0}).", _behaving);
}
_behaving = 0;
} else {
_behaving++;
if (_behaving == _probation) {
Log.Debug("CPU load below limit for {0} cycles, passing probation!", _probation);
Log.Trace("CPU load below limit for {0} cycles, passing probation!", _probation);
OnLoadBelowLimit();
} else if (_behaving > _probation) {
Log.Trace("CPU load behaving well since {0} cycles.", _behaving);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment