Well, you are right about one thing, when i was writing this helper i wasn't paying attention to counters that needs another one for support. When I became stuck with one or two for my own use, I modified the helper to achieve my needs (that were pretty
simple actually). That's why I made a modification to my code when you asked me how to treat the SimpleFraction Counter, which one I have never used before.
Seeing that base counters are more than just an inner support for the actual relevant counter I decided to add the same operations for the base counter as for its relevant (in case there is one). Further than that, I have implemented 2 more methods
that let you work straight with both counters (the relevant one and the base associated with it).
This helper is so far, a simple approach to work with performance counter without knowning all the complex theory behind them, I won't encourage any advance or complex use of performance counters through this library, because when you start learning about
it you will notice how easy was for me to do this library and probably will notice all the limitations I have imposed to actually lower the complexity of working with performance counters.
The code you pasted, let you autoincrement the base counter in case you don't want to deal with it, like on average counters. But if you prefer handling both the relevant and the base counter, you can set the autoincreased property on the attribute defining
the complex counter. For example:
"Example Average Counter",
Doing so, you will need to mannually increment the base one using one of the methods I have added, or by getting the base counter associated with the complex one:
using (CounterHelper<SingleInstance_PerformanceCounters> counterHelper =
Hope this modification fits with your needs, in case it doesn't let me know i will do my best to help you. :)