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

Enable/Disable Metrics from config file #5

Closed
nkot opened this issue Jul 11, 2014 · 2 comments
Closed

Enable/Disable Metrics from config file #5

nkot opened this issue Jul 11, 2014 · 2 comments

Comments

@nkot
Copy link
Contributor

nkot commented Jul 11, 2014

Hi @etishor

Right now Metrics.Config.CompletelyDisableMetrics disables metrics and it seems that once it is disabled there is no way to enable it by the public API.

A new feature might be to watch on some configuration file setting (like "MetricsEnabled" = true/false) and if this change - disable/enable metrics accordingly. This can be useful then running Metrics.Net in production.

Perhaps Metrics can be shipped with it's own Metrics.dll.config file and monitor it by using FileSystemWatcher?

Do you have some suggestions/ideas on this?

@etishor
Copy link
Owner

etishor commented Jul 13, 2014

Hi @nkot,

The idea behind the Metrics.Config.CompletelyDisableMetrics is to allow measurements of the impact of the metrics library itself on the application. So far, even using hundreds of metrics I have not noticed any impact on any app i'm using it on, but since the library is new I want to make sure there is a way to disable the metrics without commenting out the code.

Metrics.NET is meant to be run in production, and the metrics collection should not cause any impact. Some reporters ( like the CSV one ) might have some impact since they do IO, but they are being executed on a background thread and not very often.

If in the future there will be more features that would benefit from a config file or in general benefit from dynamic configuration - it might make sense to also have a config option for enabling or disabling the metrics, but having a config file just for this seems like an overhead for the moment.

Thanks,
Iulian

@nkot
Copy link
Contributor Author

nkot commented Jul 21, 2014

Yes, this is probably an overhead at the moment. Provided that metrics performance is good there might be no sense to actually disable it. The I/O (like CSV reporting) can be actually disabled by changing logging configuration (Log4Net or NLog). I will close this one for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants