private final long delay;
private final String soneId;
private final Histogram soneInsertDurationHistogram;
+ private final Meter soneInsertErrorMeter;
/**
* Creates a new Sone inserter.
this.core = core;
this.eventBus = eventBus;
this.freenetInterface = freenetInterface;
- this.soneInsertDurationHistogram = metricRegistry.histogram("sone.insert.duration");
+ this.soneInsertDurationHistogram = metricRegistry.histogram("sone.insert.duration", () -> new Histogram(new ExponentiallyDecayingReservoir(3000, 0)));
+ this.soneInsertErrorMeter = metricRegistry.meter("sone.insert.errors");
this.soneId = soneId;
this.soneModificationDetector = soneModificationDetector;
this.delay = delay;
success = true;
logger.log(Level.INFO, String.format("Inserted Sone ā%sā at %s.", sone.getName(), finalUri));
} catch (SoneException se1) {
+ soneInsertErrorMeter.mark();
eventBus.post(new SoneInsertAbortedEvent(sone, se1));
logger.log(Level.WARNING, String.format("Could not insert Sone ā%sā!", sone.getName()), se1);
} finally {