Skip to content

Commit

Permalink
metrics related NPE when debug=false
Browse files Browse the repository at this point in the history
closes #154
  • Loading branch information
ar committed Mar 12, 2018
1 parent aa4c66f commit eb5c1f6
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -259,7 +259,7 @@ public void run () {
abort = pt.isAborting();
evt = pt.getLogEvent();
prof = pt.getProfiler();
if (metrics != null)
if (metrics != null && prof != null)
metrics.record(getName(pt.getParticipant()) + "-resume", prof.getPartialInMillis());
if (prof != null)
prof.reenable();
Expand Down Expand Up @@ -436,7 +436,8 @@ public void setConfiguration (Configuration cfg)
throw new ConfigurationException("max-active-sessions < max-sessions");
}
callSelectorOnAbort = cfg.getBoolean("call-selector-on-abort", true);
metrics = new Metrics(new AtomicHistogram(cfg.getLong("metrics-highest-trackable-value", 60000), 2));
if (profiler)
metrics = new Metrics(new AtomicHistogram(cfg.getLong("metrics-highest-trackable-value", 60000), 2));
}
public void addListener (TransactionStatusListener l) {
synchronized (statusListeners) {
Expand Down

0 comments on commit eb5c1f6

Please sign in to comment.