0

I have this simple Performance Counter setup. The thing is that this Performance Counter is completely useless. It measures CPU usage percentage for a time span of 60 Seconds and logs the number. What I need to do is to somehow make it filter the data so that it only logs the numbers whit high CPU utilization, like 80%+. I don't want to inflate the log with garbage data.

diagnosticMonitorConfiguration.PerformanceCounters.ScheduledTransferPeriod = TimeSpan.FromMinutes(2D);
diagnosticMonitorConfiguration.PerformanceCounters.BufferQuotaInMB = 10;
TimeSpan perfSampleRate = TimeSpan.FromSeconds(60D);

 diagnosticMonitorConfiguration.PerformanceCounters.DataSources.Add(new PerformanceCounterConfiguration()
{
    CounterSpecifier = @"\Processor(_Total)\% Processor Time",
    SampleRate = perfSampleRate
});
Registered User
  • 3,669
  • 11
  • 41
  • 65

1 Answers1

0

What you are requesting is not really possible. You can transfer CPU values into the table as often as once per minute per instance. But you will want to use a custom query against the WADPerformanceCountersTable in order to get values that are only over a certain threshold.

What are you trying to do? End goal?

Igorek
  • 15,716
  • 3
  • 54
  • 92