Passioned C# / .Net Developer / Architect with a strong focus on architecture, backend & Azure Cloud development. Love to learn & share my knowledge using StackOverflow, GitHub and knowledge sessions.
I want to be able to have a number of independent EventSources with EventCounters collecting different metrics with each having its own EventListener that only receives the events from the EventSource and EventCounter that was enabled against it at potentially different frequencies.
So for instance I can have one instance monitoring cache table usage and delivering me the update rate per second and perhaps another giving me the stats against all queues in an application every five seconds.
I believe that I've achieved that with my example code, BUT I've had to manually filter the EventCounter events as they don't seem to be filtered by the framework based on the EventSource passed into EventListener.EnableEvents() method.
I'm just trying to check that I've not missed something as I'd have expected the built in filtering that appears to work on EventSource.WriteEvent() to work for the EventCounter events too.
Passioned C# / .Net Developer / Architect with a strong focus on architecture, backend & Azure Cloud development. Love to learn & share my knowledge using StackOverflow, GitHub and knowledge sessions.
If you do not want to collect metrics just don't pass the EventCounterIntervalSec argument in the dictionary. Otherwise just use another interval. I made some changes to your repo but can't push them to your repo. Can you add me as a contributer? (I can't fork your repo since it is a fork of mine)
Passioned C# / .Net Developer / Architect with a strong focus on architecture, backend & Azure Cloud development. Love to learn & share my knowledge using StackOverflow, GitHub and knowledge sessions.
So let me get this clear: you want to be able to enable or disable collection metrics of a specific EventSource?
I want to be able to have a number of independent EventSources with EventCounters collecting different metrics with each having its own EventListener that only receives the events from the EventSource and EventCounter that was enabled against it at potentially different frequencies.
So for instance I can have one instance monitoring cache table usage and delivering me the update rate per second and perhaps another giving me the stats against all queues in an application every five seconds.
I believe that I've achieved that with my example code, BUT I've had to manually filter the EventCounter events as they don't seem to be filtered by the framework based on the EventSource passed into EventListener.EnableEvents() method.
I'm just trying to check that I've not missed something as I'd have expected the built in filtering that appears to work on EventSource.WriteEvent() to work for the EventCounter events too.
If you do not want to collect metrics just don't pass the EventCounterIntervalSec argument in the dictionary. Otherwise just use another interval. I made some changes to your repo but can't push them to your repo. Can you add me as a contributer? (I can't fork your repo since it is a fork of mine)
Added as collaborator. Thanks for your help!!
I've created a pull request in which I demonstrate how I would do it. Probably better to communicate using the PR from now on.