Skip to content

Commit

Permalink
Fixed circular dependency problem which caused an ExceptionInInitiali…
Browse files Browse the repository at this point in the history
…zer error
  • Loading branch information
Thomas Dudziak authored and codahale committed Aug 11, 2011
1 parent ee0d350 commit bf55150
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion metrics-core/src/main/java/com/yammer/metrics/Metrics.java
Expand Up @@ -16,7 +16,7 @@
public class Metrics {
private static final MetricsRegistry DEFAULT_REGISTRY = new MetricsRegistry();
static {{
JmxReporter.INSTANCE.start();
JmxReporter.startDefault(DEFAULT_REGISTRY);
// make sure we initialize this so it can monitor GC etc
VirtualMachineMetrics.daemonThreadCount();
}}
Expand Down
Expand Up @@ -291,10 +291,10 @@ public List<?> values() {
}
}

public static final JmxReporter INSTANCE = new JmxReporter();

/*package*/ JmxReporter() {
this(Metrics.defaultRegistry());
private static JmxReporter INSTANCE;
public static final void startDefault(MetricsRegistry defaultMetricsRegistry) {
INSTANCE = new JmxReporter(defaultMetricsRegistry);
INSTANCE.start();
}

public JmxReporter(MetricsRegistry metricsRegistry) {
Expand Down

0 comments on commit bf55150

Please sign in to comment.