NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Retrieving Raw Performance Counter Values

You retrieve raw performance counter values by retrieving the current value of the RawValue property on the PerformanceCounter class.

To retrieve a counter’s raw value

  1. Create a PerformanceCounter instance and configure it to interact with the desired category and counter. For details, see Creating PerformanceCounter Components  or Configuring PerformanceCounter Components .
  2. Retrieve the current value of the RawValue property.

    The following example illustrates how to use the RawValue property to retrieve the current value of the BookOrders counter:

    [Visual Basic]
    Dim MyCtr as New PerformanceCounter
    MyCtr.Category= "Orders"
    MyCtr.Counter= "Total"
    Dim raw as int64
    raw = MyCtr.RawValue
    [C#]
    PerformanceCounter MyCtr = new PerformanceCounter();
    MyCtr.Category = "Orders";
    MyCtr.Counter = "Total";
    Int64 Raw = MyCtr.RawValue;

See Also

Performance Counter Value Retrieval | Retrieving Calculated Performance Counter Values  | Retrieving Performance Counter Samples  | Retrieving All Counters in a Category