2

I am programming a client to collect performance data from windows machines. This data will be send to a central server storing the information and displaying it graphically.

I am using the windows performance API to collect the system data. But now I have a little problem. The server needs to know how the data I send is related to each other and I can't find anything useful on the web about CPU counters. My question is how these counters stand in relation to each other.

Example

% processor time + % idle time = 100%

This is not too hard to find out but I cannot find any information on the other percentage values like interrupt time, privileged time or user time. How stand these in relation to the processor time for example. The ultimate goal is to add all these values and get 100% at the end.

Thank you in advance and sorry for my english, I hope my question is clear.

roohan
  • 731
  • 3
  • 8
  • 15

1 Answers1

3

This article makes clear (in the paragraph ending "would be 15%") that

% Privileged Time + % User Time + % Idle Time = 100%

Which implies that all the other CPU time measurements are subsets of one of these three measures. The "Counter Description" in perfmon describes the relationship for most of them, for example:

% DPC Time is a component of % Privileged Time because DPCs are executed in privileged mode.

% Interrupt Time isn't documented like this, but it is plainly also a component of privileged time.

arx
  • 16,686
  • 2
  • 44
  • 61
  • Hi, I am still testing. It seems that I get incorrect results when calculating % Privileged Time + % User Time + % Idle Time because of rounding/accuracy issues. I then used only raw counters to calculate the percentages and I came closer to 100% (99.98% is what I get). But I am still trying to calculate the total privileged time from other values, since I am not 100% sure which values relate to privileged time. – roohan Mar 26 '13 at 08:16
  • That's expected. The counters aren't entirely accurate so they won't sum to exactly 100%. I don't think you can assemble privileged time from other counters. It would be something like "dpc time + interrupt time + other undistinguished privileged time" and the latter isn't a separate counter. – arx Mar 26 '13 at 09:20
  • Yes I guess i can't get these kind of details on windows. Thank you for your answers. – roohan Mar 26 '13 at 16:15
  • What is difference between user and priviledged time? – variable May 06 '22 at 20:39