Question on Process % Privileged Time in SystemOverview.xml

Nov 24, 2013 at 12:04 AM
The last Analysis entry in SystemOverview.xml is for "Process % Privileged Time" and it has two thresholds. I'm wondering if the second threshold is defined correctly. In the code section for each, they each reference the variable $CollectionOfProcessPercentPrivilegedTime. However, the Datasource tag immediately preceding the second (Critical/Red) threshold specifies "\Processor(*)\% Processor Time" and a different CollectionVarName. Is this second DataSource tag incorrect, or unused/unreferenced, or is it correctly specified and needed? I didn't see that kind of mismatch in any of the other Analysis sections, couldn't figure out any way that second Datasource was being used, and thought it worth asking.
Thanks,
Coordinator
Dec 5, 2013 at 1:49 AM
Hi gmChv,

I love your attention to detail. Thank you for asking about this. I reviewed the code and it is correct.
<THRESHOLD NAME="More than 10% of overall kernel mode time" CONDITION="Warning" COLOR="Yellow" PRIORITY="50">
  <CODE><![CDATA[[Int] $NumberOfLogicalProcessors = $CollectionOfProcessorPercentProcessorTimeAll.Count - 1
$OverallProcessThreshold = $NumberOfLogicalProcessors * 10
StaticThreshold -CollectionOfCounterInstances $CollectionOfProcessPercentPrivilegedTime -Operator 'gt' -Threshold $OverallProcessThreshold]]></CODE>
</THRESHOLD>

<THRESHOLD NAME="More than 20% of overall kernel mode time" CONDITION="Critical" COLOR="Red" PRIORITY="100">
  <DESCRIPTION><![CDATA[]]></DESCRIPTION>
  <CODE><![CDATA[[Int] $NumberOfLogicalProcessors = $CollectionOfProcessorPercentProcessorTimeAll.Count - 1
$OverallProcessThreshold = $NumberOfLogicalProcessors * 20
StaticThreshold -CollectionOfCounterInstances $CollectionOfProcessPercentPrivilegedTime -Operator 'gt' -Threshold $OverallProcessThreshold]]></CODE>
</THRESHOLD>
The second datasource tag is there to get a count of the number of processor instances. This is because any single process has the potential of consuming up to 100% times the number of processors. I use $CollectionOfProcessorPercentProcessorTimeAll.Count to get the number of processors, multiply it by 10 or 20 depending on the threshold, then compare it to each of the processes using % Privileged Time.
Dec 13, 2013 at 6:22 PM
Clint,

Thanks for your explanation. I now see that the PAL code evaluates all of the DataSource definitions within an Analysis section first (Type="generated" DataSources after other Types of DataSources) before evaluating each Threshold specified within that Analysis section. I also see where the Code section in each of these two Threshold definitions makes use of both of the DataSource definitions included in this Analysis section. That all makes sense now.

Thanks,