System.Performance.AveragerCondition

Applies To: Operations Manager 2007 R2

The System.Performance.AveragerCondition condition detection module type calculates the average value of a specified number of input values. This module accepts System.Performance.Data as the input data type and outputs System.Performance.Data data.

Usage

Use this module type within workflow to assess the specified number of performance samples and to output the average value instead of the raw input value.

Type Definition

<ConditionDetectionModuleType ID="System.Performance.AveragerCondition" Accessibility="Public" Stateful="true" PassThrough="false" Batching="false">
  <Configuration>
    <xsd:element minOccurs="1" maxOccurs="1" name="NumSamples" type="xsd:unsignedInt" />
  </Configuration>
  <OverrideableParameters>
    <OverrideableParameter ID="NumSamples" ParameterType="int" Selector="$Config/NumSamples$" />
  </OverrideableParameters>
  <ModuleImplementation>
    <Native>
      <ClassID>05C8C114-7D2A-4159-B3AB-52BA3F40439B</ClassID>
    </Native>
  </ModuleImplementation>
  <OutputType>System.Performance.Data</OutputType>
  <InputTypes>
    <InputType>System.Performance.Data</InputType>
  </InputTypes>
</ConditionDetectionModuleType>

Parameters

The System.Performance.AveragerCondition supports the following configuration parameters:

Parameter Type Overrideable Description

NumSamples

Unsigned Integer

False

Contains the number of samples to average over.

Composition

The System.Performance.AveragerCondition module is a native module.

None.

External Module References

The System.Performance.AveragerCondition module is a member of the public module described in the following table.

Module Type Library Usage

System.Performance.AverageThresholdCondition

System.Performance.Library

Outputs performance data if the specified threshold is exceeded by the average value of performance samples.

Remarks

A module of this type generates data at the same frequency as the input data items after the initial number of specified samples have passed. For example, if the frequency of the incoming data is once every 60 seconds and the module is configured to sample over 4 samples, there will be no data item output for 240 seconds after the workflow is initialized for the first time.

Sample

The following example shows a simple performance collection rule that reads data from a Windows performance counter and averages this over five samples:

<Rule ID="Microsoft.Samples.ProcessCollection" Target="Microsoft.Samples.ApplicationX">
  <Category>Custom</Category>
  <DataSources>
    <DataSource ID="PerfDS" TypeID="Perf!System.Performance.OptimizedDataProvider">
      <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
      <CounterName><![CDATA[% Processor Time]]></CounterName>
      <ObjectName>Process</ObjectName>
      <InstanceName>ApplicationX</InstanceName>
      <AllInstances>false</AllInstances>
      <Frequency>60</Frequency>
      <Tolerance>0</Tolerance>
      <ToleranceType>Absolute</ToleranceType>
      <MaximumSampleSeparation>1</MaximumSampleSeparation>
    </DataSource>
  </DataSources>
  <ConditionDetection ID="Averager" TypeID="Perf!System.Performance.AveragerCondition">
    <NumSamples>5</NumSamples>
  </ConditionDetection>
  <WriteActions>
    <WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData" />
  </WriteActions>
</Rule>

Any data source that generates performance data can be used with the averager module. The following example shows a script-based data source that maps data to a performance counter before using the averager module. The rule is configured to average over two samples, and it writes the data to the Operations Manager database only:

<Rule ID="Microsoft.Samples.PerfMapperSingleAverager" Target="Microsoft.Samples.ApplicationX">
<Category>Custom</Category>
<DataSources>
  <DataSource ID="Script" TypeID="Windows!Microsoft.Windows.TimedScript.PerformanceProvider">
    <IntervalSeconds>30</IntervalSeconds>
    <SyncTime />
    <ScriptName>Microsoft.Samples.PerfMapper.vbs</ScriptName>
    <Arguments />
    <ScriptBody>
      Option Explicit
      Dim OMApi, OMPBag

      Set OMApi = CreateObject("MOM.ScriptAPI")
      Set OMPBag = OMApi.CreatePropertyBag()

      Randomize()
      Call OMPBag.AddValue("Value", CInt(Rnd()*100))

      Call OMAPI.Return(OMPBag)
    </ScriptBody>
    <TimeoutSeconds>10</TimeoutSeconds>
    <ObjectName>AppplicationX</ObjectName>
    <CounterName>Averager Test</CounterName>
    <InstanceName />
    <Value>$Data/Property[@Name='Value']$</Value>
  </DataSource>
</DataSources>
<ConditionDetection ID="Averager" TypeID="Perf!System.Performance.AveragerCondition">
  <NumSamples>2</NumSamples>
</ConditionDetection>
<WriteActions>
  <WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData" />
</WriteActions>
</Rule>

Information

   

Module Type

ConditionDetectionModuleType

InputType

System.Performance.Data

Output Type

System.Performance.Data

Implementation

Native

Library

System.Performance.Library