@Override public void started() { counter.inc(); }
void markBytesWritten(long bytes) { currentGenCounter.addAndGet(bytes); byteCounter.inc(bytes); } }
void markBytesWritten(long bytes) { currentGenCounter.addAndGet(bytes); byteCounter.inc(bytes); } }
@Override public boolean addIfNotFullWithoutWait(LuceneDoc doc){ checkState(!stopped); boolean added = docsQueue.offer(doc); if (added) { queueSizeStats.inc(); if (log.isTraceEnabled()){ log.trace("Adding {} without wait to queue at size {}", doc, docsQueue.size()); } } return added; }
@Override public boolean addIfNotFullWithoutWait(LuceneDoc doc){ checkState(!stopped); boolean added = docsQueue.offer(doc); if (added) { queueSizeStats.inc(); if (log.isTraceEnabled()){ log.trace("Adding {} without wait to queue at size {}", doc, docsQueue.size()); } } return added; }
@Override public void written(long delta) { writeStats.mark(delta); repoSize.inc(delta); }
@Override public void onCommitQueued(Thread t) { commitQueueSize.inc(); commitsTracker.trackQueuedCommitOf(t); }
@Override public void recordValue(long value) { super.recordValue(value); long currentValue = maxQueueLengthCounter.getCount(); maxQueueLengthCounter.inc(Math.max(value, currentValue) - currentValue); } };
@Override public void recordValue(long value) { super.recordValue(value); long currentValue = maxQueueLengthCounter.getCount(); maxQueueLengthCounter.inc(Math.max(value, currentValue) - currentValue); } };
public FileStoreStats(StatisticsProvider statisticsProvider, FileStore store, long initialSize) { this.statisticsProvider = statisticsProvider; this.store = store; this.writeStats = statisticsProvider.getMeter(SEGMENT_WRITES, StatsOptions.DEFAULT); this.repoSize = statisticsProvider.getCounterStats(SEGMENT_REPO_SIZE, StatsOptions.DEFAULT); this.journalWriteStats = statisticsProvider.getMeter(JOURNAL_WRITES, StatsOptions.DEFAULT); repoSize.inc(initialSize); }
long writeEntry(long msb, long lsb, byte[] data, int offset, int size, GCGeneration generation) throws IOException { checkNotNull(data); checkPositionIndexes(offset, offset + size, data.length); synchronized (this) { checkState(!closed); archive.writeSegment(msb, lsb, data, offset, size, generation.getGeneration(), generation.getFullGeneration(), generation.isCompacted()); segmentCount.inc(); long currentLength = archive.getLength(); checkState(currentLength <= Integer.MAX_VALUE); return currentLength; } }
public SessionImpl(SessionContext sessionContext) { this.sessionContext = sessionContext; this.sd = sessionContext.getSessionDelegate(); this.sessionCounter = sessionContext.getCount(SESSION_COUNT); sessionCounter.inc(); sessionContext.getMeter(Type.SESSION_LOGIN_COUNTER).mark(); }
public SessionImpl(SessionContext sessionContext) { this.sessionContext = sessionContext; this.sd = sessionContext.getSessionDelegate(); this.sessionCounter = sessionContext.getCount(SESSION_COUNT); sessionCounter.inc(); sessionContext.getMeter(Type.SESSION_LOGIN_COUNTER).mark(); }
public SessionImpl(SessionContext sessionContext) { this.sessionContext = sessionContext; this.sd = sessionContext.getSessionDelegate(); this.sessionCounter = sessionContext.getCount(SESSION_COUNT); sessionCounter.inc(); sessionContext.getMeter(Type.SESSION_LOGIN_COUNTER).mark(); }
@Override public void finished(VersionGCStats stats) { activeTimer.update(stats.active.elapsed(MICROSECONDS), MICROSECONDS); readDocTimer.update(stats.collectDeletedDocsElapsed, MICROSECONDS); checkDeletedTimer.update(stats.checkDeletedDocsElapsed, MICROSECONDS); deletedDocTimer.update(stats.deleteDeletedDocsElapsed, MICROSECONDS); deletedSplitDocTimer.update(stats.collectAndDeleteSplitDocsElapsed, MICROSECONDS); sortIdsTimer.update(stats.sortDocIdsElapsed, MICROSECONDS); resetDeletedFlagTimer.update(stats.updateResurrectedDocumentsElapsed, MICROSECONDS); if (!stats.success) { failureCounter.inc(); } }
@Test public void counter() throws Exception { CounterStats counterStats = statsProvider.getCounterStats("test", StatsOptions.DEFAULT); assertNotNull(counterStats); counterStats.inc(); assertEquals(1, statsImpl(statsProvider).getCounter("test", false).get()); assertTrue(getRegisteredTimeSeries(statsProvider).contains("test")); }
@Test public void basicSetup() throws Exception { assertNotNull(statsProvider.getStats()); CounterStats stats = statsProvider.getCounterStats(RepositoryStatistics.Type.SESSION_COUNT.name(), StatsOptions.DEFAULT); stats.inc(); assertEquals(1, statsImpl(statsProvider).getCounter(RepositoryStatistics.Type.SESSION_COUNT).get()); }