Skip to content

Commit

Permalink
Additional logging to add more context at finest detail for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
GDownes committed Dec 17, 2021
1 parent bb3defe commit c430d85
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ public Meter meter(SolrInfoBean info, String registry, String metricName, String
public void removeRegistry(String registry) {
Weaver.callOriginal();
MetricUtil.clearRegistry(registry);
NewRelic.getAgent().getLogger().log(Level.FINEST, "Removed {0} metric registry", registry);
}

public void clearRegistry(String registry) {
Weaver.callOriginal();
MetricUtil.clearRegistry(registry);
NewRelic.getAgent().getLogger().log(Level.FINEST, "Cleared {0} metric registry", registry);
}

public Set<String> clearMetrics(String registry, String... metricPath) {
Expand All @@ -80,12 +82,14 @@ public Set<String> clearMetrics(String registry, String... metricPath) {
for (String removedMetric: removedMetrics) {
MetricUtil.removeMetric(registry, removedMetric);
}
NewRelic.getAgent().getLogger().log(Level.FINEST, "Cleared {0} metrics from {1} metric registry", removedMetrics.size(), registry);
}
return removedMetrics;
}

public void swapRegistries(String registry1, String registry2) {
Weaver.callOriginal();
MetricUtil.swapRegistries(registry1, registry2);
NewRelic.getAgent().getLogger().log(Level.FINEST, "Swapped {0} metric registry to {1} metric registry", registry1, registry2);
}
}

0 comments on commit c430d85

Please sign in to comment.