Better might be to look at AverageXXX performance counters
...CountPerTimeInterval sounds particularly useful for you in this case.
http://www.informit.com/guides/content.asp?g=dotnet&seqNum=254 gives some
examples. The RawFraction type (also included in that article) is exactly
what you describe below.
Cheers,
Greg Young
MVP - C#
> Hi,
>
[quoted text clipped - 23 lines]
> etc we do not use the default PerformanceMonitor.Increment and
> PerformanceMonitor.IncrementBy methods.
vecozo@online.nospam - 08 May 2006 21:17 GMT
Thanks Greg!
The link cleared up a lot. It works!
Regards,
Martijn
PS For those who are looking for the same answer:
What I did not understand before was that you actually need two performance
counters, a XXXBase (denominator) and an AverageXXX (nominator):
// Add the counter.
CounterCreationData rawFraction = new CounterCreationData();
rawFraction.CounterType =
PerformanceCounterType.AverageCount64;
rawFraction.CounterName = averageCounterName;
CCDC.Add(rawFraction);
// Add the base counter.
CounterCreationData rawFractionBase = new
CounterCreationData();
rawFractionBase.CounterType =
PerformanceCounterType.AverageBase;
rawFractionBase.CounterName = averageCounterNameBase;
CCDC.Add(rawFractionBase);
The averageCounterName now reads [rawFractionCounter].rawvalue /
[rawFractionBase].rawvalue.
______________________________
> Better might be to look at AverageXXX performance counters
> ....CountPerTimeInterval sounds particularly useful for you in this case.
[quoted text clipped - 34 lines]
> > etc we do not use the default PerformanceMonitor.Increment and
> > PerformanceMonitor.IncrementBy methods.