DocumentStoreStats implements DocumentStoreStatsCollector, DocumentStoreStatsMBean { @Override public void doneRemove(long timeTakenNanos, Collection<? extends Document> collection, int removeCount) { if (collection == Collection.NODES) { if (removeCount > 0) { removeNodes.mark(removeCount); removeNodesTimer.update(timeTakenNanos / removeCount, TimeUnit.NANOSECONDS); } } perfLog(timeTakenNanos, "remove [{}]", removeCount); } DocumentStoreStats(StatisticsProvider provider); @Override void doneFindCached(Collection<? extends Document> collection, String key); @Override void doneFindUncached(long timeTakenNanos, Collection<? extends Document> collection, String key,
                                 boolean docFound, boolean isSlaveOk); @Override void doneQuery(long timeTakenNanos, Collection<? extends Document> collection, String fromKey, String toKey,
                          boolean indexedProperty, int resultSize, long lockTime, boolean isSlaveOk); @Override void doneCreate(long timeTakenNanos, Collection<? extends Document> collection, List<String> ids, boolean insertSuccess); @Override void doneCreateOrUpdate(long timeTakenNanos,
                                   Collection<? extends Document> collection,
                                   List<String> ids); @Override void doneFindAndModify(long timeTakenNanos, Collection<? extends Document> collection, String key, boolean newEntry,
                                  boolean success, int retryCount); @Override void doneRemove(long timeTakenNanos,
                           Collection<? extends Document> collection,
                           int removeCount); @Override long getNodesFindCount(); @Override long getNodesFindQueryCount(); @Override long getNodesFindMissingCount(); @Override long getNodesReadByQueryCount(); @Override long getNodesCreateCount(); @Override long getNodesUpdateCount(); @Override long getNodesRemoveCount(); @Override long getJournalCreateCount(); @Override long getJournalReadCount(); @Override CompositeData getFindCachedNodesHistory(); @Override CompositeData getFindSplitNodesHistory(); @Override CompositeData getFindNodesFromPrimaryHistory(); @Override CompositeData getFindNodesFromSlaveHistory(); @Override CompositeData getFindNodesMissingHistory(); @Override CompositeData getQueryNodesFromSlaveHistory(); @Override CompositeData getQueryNodesFromPrimaryHistory(); @Override CompositeData getQueryNodesLockHistory(); @Override CompositeData getQueryJournalHistory(); @Override CompositeData getCreateJournalHistory(); @Override CompositeData getCreateNodesHistory(); @Override CompositeData getUpdateNodesHistory(); @Override CompositeData getUpdateNodesRetryHistory(); @Override CompositeData getUpdateNodesFailureHistory(); @Override CompositeData getRemoveNodesHistory(); static final int PERF_LOG_THRESHOLD; }
@Test public void doneRemove() throws Exception { stats.doneRemove(100, Collection.NODES, 42); assertEquals(42, getMeter(DocumentStoreStats.NODES_REMOVE).getCount()); stats.doneRemove(100, Collection.NODES, 17); assertEquals(59, getMeter(DocumentStoreStats.NODES_REMOVE).getCount()); }