9

I'm collecting some performance data on various virtual machines. The DataCollectorSet is initialized as follows:

set.Subdirectory = set.name;
set.SubdirectoryFormat = AutoPathFormat.plaYearMonthDay;

var schedule = set.Schedules.CreateSchedule();
schedule.Days = WeekDays.plaEveryday;
schedule.StartDate = DateTime.Now;

set.Schedules.Add(schedule);

set.Commit(set.name, null, CommitMode.plaCreateNew);

Then I add a collector:

var collector = (IPerformanceCounterDataCollector)set.DataCollectors.CreateDataCollector(DataCollectorType.plaPerformanceCounter);

collector.FileName = counterPath.Replace("\\", "_");
collector.LogAppend = true;
collector.FileNameFormat = AutoPathFormat.plaYearMonthDay;
collector.SampleInterval = 60u;
collector.SegmentMaxRecords = 1440;
collector.LogFileFormat = FileFormat.plaTabSeparated;

set.DataCollectors.Add(collector);

var counters = new string[1];
counters[0] = counterPath;
collector.PerformanceCounters = counters;

set.Commit(set.name, null, CommitMode.plaCreateOrModify);

When I run this with \LogicalDisk(_Total)\% Disk Time, on dozens of machines, I get values that look like percentages, as expected — they're mostly around 0.00 through 5.00, but sometimes, during high activity, go into the double digits.

On one machine, however, all values are above 100. They all appear to be between about 120 and 170, regardless of whether the machine appears to be busy or not. Meanwhile, running perfmon manually with the same counter shows the presumably correct values — it goes near 100% when busy, and otherwise stays below 10%.

Here's the first few output lines from a machine with expected results:

"(PDH-TSV 4.0) (Mitteleuropäische Sommerzeit)(-120)" "\BR-DOMAIN\Logischer Datenträger(_Total)\Zeit (%)" "08/04/2015 01:00:18.425" " " "08/04/2015 01:01:18.407" "2.4181960253316448" "08/04/2015 01:02:18.406" "0.24834083322649675" "08/04/2015 01:03:18.404" "0.19900577879613995"

On the presumably misconfigured one, instead, they look like this:

"(PDH-TSV 4.0) (Mitteleuropäische Sommerzeit)(-120)" "\BR-SQL-03\Logischer Datenträger(_Total)\Zeit (%)" "08/04/2015 09:22:07.685" " " "08/04/2015 09:23:07.686" "138.63521370727958" "08/04/2015 09:24:07.679" "141.86027406369067" "08/04/2015 09:25:07.679" "124.80150934108948"

The machines that work as expected run a range of OSes (2008 R2, 2012, 2012 R2) in both German and English, and it doesn't appear to be something with the regional settings either.

Sören Kuklau
  • 18,090
  • 5
  • 45
  • 82

1 Answers1

2

% disk time is merely the average disk queue length multiplied by 100. See this article for more details.

The “% Disk Time” counter is nothing more than the “Avg. Disk Queue Length” counter multiplied by 100. It is the same value displayed in a different scale. If the Avg. Disk queue length is equal to 1, the %Disk Time will equal 100. If the Avg. Disk Queue Length is 0.37, then the %Disk Time will be 37. This is the reason why you can see the % Disk Time being greater than 100%, all it takes is the Avg. Disk Queue length value being greater than 1.

Yoad Snapir
  • 508
  • 2
  • 10