DocumentNodeStoreStats implements DocumentNodeStoreStatsCollector { @Override public void doneLeaseUpdate(long timeMicros) { leaseUpdate.update(timeMicros, TimeUnit.MICROSECONDS); } DocumentNodeStoreStats(StatisticsProvider sp); @Override void doneBackgroundRead(BackgroundReadStats stats); @Override void doneBackgroundUpdate(BackgroundWriteStats stats); @Override void doneLeaseUpdate(long timeMicros); @Override void doneBranchCommit(); @Override void doneMergeBranch(int numCommits, int numChanges); @Override void doneMerge(int numChanges,
                          int numRetries,
                          long timeMillis,
                          long suspendMillis,
                          boolean exclusive); @Override void failedMerge(int numRetries, long timeMillis, long suspendMillis, boolean exclusive); @Override void doneWaitUntilHead(long waitMicros); @Override void doneMergeLockAcquired(long timeMicros); @Override void doneCommitHookProcessed(long timeMicros); @Override void doneChangesApplied(long timeMicros);  }
@Test public void leaseUpdate() { stats.doneLeaseUpdate(47); stats.doneLeaseUpdate(53); Timer t = getTimer(DocumentNodeStoreStats.LEASE_UPDATE); Snapshot s = t.getSnapshot(); assertEquals(MICROSECONDS.toNanos(47), s.getMin()); assertEquals(MICROSECONDS.toNanos(53), s.getMax()); assertEquals(MICROSECONDS.toNanos(50), s.getMean(), 0.01); }