Closed Gonyoda closed 2 years ago
Using Event Counters or Metrics.Meter is the idiomatic way of doing counters/stats in .NET Core. But accessing these counters on an as-needed basis instead of every X seconds is virtually impossible according to EventListener docs. Same for Metrics which seem to record every time the metric is changed. The approach in this PR, using a method that is called on demand is better for the current use case of these Parallafka metrics - to be displayed only on demand, not on a periodic timer.
Closing as it's now part of https://github.com/alexreidy/parallafka-for-dotnet/pull/8
You can get stats that when serialized over JSON, look like this: