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!

Writing Values to Performance Counters

You write a value to a counter by incrementing the counter’s current raw value by a positive or negative number. You do this using the IncrementBy method on the PerformanceCounter class.

Note   Incrementing by a negative number decrements the counter by the absolute value of the number. For example, incrementing with a value of 3 will increase the counter’s raw value by three. Incrementing with a value of –3 will decrease the counter’s raw value by three.

To write values to performance counters

  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. Call the IncrementBy method, specifying the amount to increment by:
    • To increase the counter’s raw value, specify a positive number.
– or –

See Also

Introduction to Monitoring Performance Thresholds