Q: How do I get the reports created on application shutdown?
mattiasw2 opened this issue · comments
The web interface is really nice, but it would be nice to get the reports automatically at end of execution. Is there some kind of hook for this?
@mattiasw2 I'm not sure if this is what you mean by "get the reports", but you can manually run a report by using something like this:
var data = Metric.Context(string.Empty).DataProvider.CurrentMetricsData;
new ConsoleReport().RunReport(data, () => HealthChecks.GetStatus(), CancellationToken.None);
new StringReport().RunReport(data, () => HealthChecks.GetStatus(), CancellationToken.None);
Closing this for now, let me know if you need more info.
Yes, that was what I was looking for. Thanks!