com.netflix.eventbus.bridge.SimpleEventBusBridgeStats Maven / Gradle / Ivy
package com.netflix.eventbus.bridge;
import java.util.concurrent.atomic.AtomicLong;
public class SimpleEventBusBridgeStats implements EventBusBridgeStats {
private final AtomicLong consumeErrorCount = new AtomicLong(0);
private final AtomicLong consumeCount = new AtomicLong(0);
private volatile Exception lastConsumeException = null;
@Override
public long getConsumeCount() {
return consumeCount.get();
}
@Override
public long getConsumeErrorCount() {
return consumeErrorCount.get();
}
@Override
public long incConsumeCount() {
return consumeCount.incrementAndGet();
}
@Override
public long incConsumeErrorCount(Exception e) {
this.lastConsumeException = e;
return this.consumeErrorCount.incrementAndGet();
}
@Override
public Exception getLastConsumeException() {
return this.lastConsumeException;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy