This repository has been archived by the owner on Sep 1, 2020. It is now read-only.
Do not explicitly record metrics - trace_execution_scoped will automatically do it #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Howdy! First off, thanks for this gem - it's great to see community-supported extensions to newrelic_rpm like this. I work at New Relic and have referred a number of folks looking for Moped instrumentation here. I noticed a bug in the latest version, however that's leading to double-counting of some metrics. Details below from the commit message:
The previous code was double-counting metrics for all queries through Moped,
because of the fact that trace_execution_scoped will automatically record
metrics. The net effect was that the database band on the overview graph in New
Relic was twice as large as it should have been (because the 'ActiveRecord/all'
metric was being recorded twice).
This change removes the additional explicit call to record_metrics (which is not
a public API and may change unpredicatbly) so that metrics are no longer double-counted.