Merge pull request #3416 from izeye/typo-20150705

* pr/3416:
  Fix typo
pull/3416/merge
Stephane Nicoll 10 years ago
commit bcb9ad8f64

@ -94,16 +94,16 @@ public class DropwizardMetricWriter implements MetricWriter {
else { else {
final double gauge = value.getValue().doubleValue(); final double gauge = value.getValue().doubleValue();
// Ensure we synchronize to avoid another thread pre-empting this thread after // Ensure we synchronize to avoid another thread pre-empting this thread after
// remove causing an error in CodaHale metrics // remove causing an error in Dropwizard Metrics
// NOTE: CodaHale provides no way to do this atomically // NOTE: Dropwizard Metrics provides no way to do this atomically
synchronized (getGuageLock(name)) { synchronized (getGaugeLock(name)) {
this.registry.remove(name); this.registry.remove(name);
this.registry.register(name, new SimpleGauge(gauge)); this.registry.register(name, new SimpleGauge(gauge));
} }
} }
} }
private Object getGuageLock(String name) { private Object getGaugeLock(String name) {
Object lock = this.gaugeLocks.get(name); Object lock = this.gaugeLocks.get(name);
if (lock == null) { if (lock == null) {
Object newLock = new Object(); Object newLock = new Object();

Loading…
Cancel
Save