public TimerStats.Context startReadTimer() { return this.readTimer.time(); }
TimerStats.Context startUpLoaderTimer() { return this.uploadTimer.time(); }
public TimerStats.Context startLoaderTimer() { return this.loadTimer.time(); }
TimerStats.Context startUpLoaderTimer() { return this.uploadTimer.time(); }
TimerStats.Context startUpLoaderTimer() { return this.uploadTimer.time(); }
public TimerStats.Context startReadTimer() { return this.readTimer.time(); }
public TimerStats.Context startLoaderTimer() { return this.loadTimer.time(); }
TimerStats.Context ctx = refreshTimer.time();
TimerStats.Context ctx = refreshTimer.time();
public NRTIndex(LuceneIndexDefinition definition, IndexCopier indexCopier, IndexUpdateListener refreshPolicy, @Nullable NRTIndex previous, StatisticsProvider statisticsProvider, NRTDirectoryFactory directoryFactory, boolean assertAllReadersClosed) { this.definition = definition; this.indexCopier = indexCopier; this.refreshPolicy = refreshPolicy; this.previous = previous; this.statisticsProvider = statisticsProvider; this.directoryFactory = directoryFactory; this.assertAllReadersClosed = assertAllReadersClosed; this.openedReaders = assertAllReadersClosed ? new LinkedList<>() : Collections.emptyList(); this.refreshTimer = statisticsProvider.getTimer(metricName("REFRESH_TIME"), StatsOptions.METRICS_ONLY); this.sizeHisto = statisticsProvider.getHistogram(metricName("SIZE"), StatsOptions.METRICS_ONLY); this.openTime = statisticsProvider.getTimer(metricName("OPEN_TIME"), StatsOptions.METRICS_ONLY).time(); }
public NRTIndex(LuceneIndexDefinition definition, IndexCopier indexCopier, IndexUpdateListener refreshPolicy, @Nullable NRTIndex previous, StatisticsProvider statisticsProvider, NRTDirectoryFactory directoryFactory, boolean assertAllReadersClosed) { this.definition = definition; this.indexCopier = indexCopier; this.refreshPolicy = refreshPolicy; this.previous = previous; this.statisticsProvider = statisticsProvider; this.directoryFactory = directoryFactory; this.assertAllReadersClosed = assertAllReadersClosed; this.openedReaders = assertAllReadersClosed ? new LinkedList<>() : Collections.emptyList(); this.refreshTimer = statisticsProvider.getTimer(metricName("REFRESH_TIME"), StatsOptions.METRICS_ONLY); this.sizeHisto = statisticsProvider.getHistogram(metricName("SIZE"), StatsOptions.METRICS_ONLY); this.openTime = statisticsProvider.getTimer(metricName("OPEN_TIME"), StatsOptions.METRICS_ONLY).time(); }
TimerStats.Context ctx = timer.time(); Set<String> indexPaths = Sets.newHashSet(); for (IndexedPathInfo indexData : indexedPaths) {
TimerStats.Context ctx = timer.time(); Set<String> indexPaths = Sets.newHashSet(); for (IndexedPathInfo indexData : indexedPaths) {
public QueryResult executeQuery(String statement, String language, long limit, long offset, HashMap<String, Value> bindVariableMap) throws RepositoryException { try { Map<String, PropertyValue> bindMap = convertMap(bindVariableMap); TimerStats.Context context = queryDuration.time(); Result r = queryEngine.executeQuery( statement, language, limit, offset, bindMap, sessionContext.getSessionLocalMappings()); queryCount.mark(); long millis = TimeUnit.NANOSECONDS.toMillis(context.stop()); queryOpsLogger.debug("Executed query [{}] in [{}] ms", statement, millis); sessionContext.getStatisticManager() .logQueryEvaluationTime(language, statement, millis); return new QueryResultImpl(sessionContext, r); } catch (IllegalArgumentException e) { throw new InvalidQueryException(e); } catch (ParseException e) { throw new InvalidQueryException(e); } }
public QueryResult executeQuery(String statement, String language, long limit, long offset, HashMap<String, Value> bindVariableMap) throws RepositoryException { try { Map<String, PropertyValue> bindMap = convertMap(bindVariableMap); TimerStats.Context context = queryDuration.time(); Result r = queryEngine.executeQuery( statement, language, limit, offset, bindMap, sessionContext.getSessionLocalMappings()); queryCount.mark(); long millis = TimeUnit.NANOSECONDS.toMillis(context.stop()); queryOpsLogger.debug("Executed query [{}] in [{}] ms", statement, millis); sessionContext.getStatisticManager() .logQueryEvaluationTime(language, statement, millis); return new QueryResultImpl(sessionContext, r); } catch (IllegalArgumentException e) { throw new InvalidQueryException(e); } catch (ParseException e) { throw new InvalidQueryException(e); } }
public QueryResult executeQuery(String statement, String language, long limit, long offset, HashMap<String, Value> bindVariableMap) throws RepositoryException { try { Map<String, PropertyValue> bindMap = convertMap(bindVariableMap); TimerStats.Context context = queryDuration.time(); Result r = queryEngine.executeQuery( statement, language, limit, offset, bindMap, sessionContext.getSessionLocalMappings()); queryCount.mark(); long millis = TimeUnit.NANOSECONDS.toMillis(context.stop()); queryOpsLogger.debug("Executed query [{}] in [{}] ms", statement, millis); sessionContext.getStatisticManager() .logQueryEvaluationTime(language, statement, millis); return new QueryResultImpl(sessionContext, r); } catch (IllegalArgumentException e) { throw new InvalidQueryException(e); } catch (ParseException e) { throw new InvalidQueryException(e); } }
@Test public void timerContext() throws Exception{ AtomicLong counter = new AtomicLong(); VirtualClock clock = new VirtualClock(); Timer time = new Timer(new ExponentiallyDecayingReservoir(), clock); TimerStats timerStats = new CompositeStats(counter, time); TimerStats.Context context = timerStats.time(); clock.tick = TimeUnit.SECONDS.toNanos(314); context.close(); assertEquals(1, time.getCount()); assertEquals(TimeUnit.SECONDS.toMillis(314), counter.get()); }
@Test public void timerContext() throws Exception{ VirtualClock clock = new VirtualClock(); Timer time = new Timer(new ExponentiallyDecayingReservoir(), clock); TimerStats timerStats = new TimerImpl(time); TimerStats.Context context = timerStats.time(); clock.tick = TimeUnit.SECONDS.toNanos(314); context.close(); assertEquals(1, time.getCount()); assertEquals(TimeUnit.SECONDS.toNanos(314), time.getSnapshot().getMax()); }
Context timer = flushTimer.time(); try { tryFlush();