Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to dump statistics on demand #6310

Closed
OracPrime opened this issue Feb 18, 2020 · 0 comments
Closed

Ability to dump statistics on demand #6310

OracPrime opened this issue Feb 18, 2020 · 0 comments
Labels
stale Issues with no activity for the past 6 months

Comments

@OracPrime
Copy link
Contributor

OracPrime commented Feb 18, 2020

I'd quite like to be able to dump statistics at particular times, rather than just wait for a timer to go off.
I'm happy to submit a PR, but wanted to float my design here and see if it meets approval.

The statistics are done by ClientStatisticsManager and SiloStatisticsManager, both of which are internal classes with no public interface. They are each registered as singletons inthe service container.

I propose defining an IStatisticsManager interface with a single Dump method on it. Because the context for registering the singletons is different, I believe I can make both ClientStatisticsManager and SiloStatisticsManager implement IStatisticsManager.

Users wishing to use the manual dump would then use code like this

  ISiloHostBuilder builder = new SiloHostBuilder()
                                                     .NormalConfigCalls();
  var host = builder.Build();
  var stats = host.Services.GetService<IStatisticsManager>();

and then stats.Dump() when required.

Does that sound reasonable/correct?

ReubenBond added a commit that referenced this issue Feb 18, 2020
Co-authored-by: Reuben Bond <reuben.bond@gmail.com>
sergeybykov pushed a commit that referenced this issue Feb 22, 2020
Co-authored-by: Reuben Bond <reuben.bond@gmail.com>
(cherry picked from commit c11be30)
@dotnet dotnet locked as resolved and limited conversation to collaborators Sep 25, 2021
@ghost ghost added the stale Issues with no activity for the past 6 months label Dec 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale Issues with no activity for the past 6 months
Projects
None yet
Development

No branches or pull requests

1 participant