I am trying to c# PerformanceCounter Library part of System.Diagnostic. While setting the raw value of the counter using
public long RawValue { set; get; }
I was passing the Rawalue to 0. However I noticed that Maximum value of the counter was reset to a very large number. Previous value of the counter was 2
Can someone help me out and point out any mistake I might be making, here is my code
using (PerformanceCounter ctr = new
PerformanceCounter(Settings.Instance.SetSourceAppliacationName, counter.ToString(), false))
{
if (incrementCounter)
{
ctr.IncrementBy(value);
}
else
{
ctr.RawValue = value;
}
}