Search in sources :

Example 1 with MetricRateEstimator

use of org.apache.jackrabbit.oak.plugins.index.progress.MetricRateEstimator in project jackrabbit-oak by apache.

the class OutOfBandIndexer method configureEstimators.

private void configureEstimators(IndexUpdate indexUpdate) {
    StatisticsProvider statsProvider = indexHelper.getStatisticsProvider();
    if (statsProvider instanceof MetricStatisticsProvider) {
        MetricRegistry registry = ((MetricStatisticsProvider) statsProvider).getRegistry();
        indexUpdate.setTraversalRateEstimator(new MetricRateEstimator(REINDEX_LANE, registry));
    }
    NodeCounterMBeanEstimator estimator = new NodeCounterMBeanEstimator(indexHelper.getNodeStore());
    indexUpdate.setNodeCountEstimator(estimator);
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) MetricRateEstimator(org.apache.jackrabbit.oak.plugins.index.progress.MetricRateEstimator) MetricStatisticsProvider(org.apache.jackrabbit.oak.plugins.metric.MetricStatisticsProvider) MetricStatisticsProvider(org.apache.jackrabbit.oak.plugins.metric.MetricStatisticsProvider) StatisticsProvider(org.apache.jackrabbit.oak.stats.StatisticsProvider) NodeCounterMBeanEstimator(org.apache.jackrabbit.oak.plugins.index.progress.NodeCounterMBeanEstimator)

Example 2 with MetricRateEstimator

use of org.apache.jackrabbit.oak.plugins.index.progress.MetricRateEstimator in project jackrabbit-oak by apache.

the class AsyncIndexUpdate method configureRateEstimator.

private void configureRateEstimator(IndexUpdate indexUpdate) {
    //As metrics is an optional library guard the access with the check
    if (statisticsProvider.getClass().getSimpleName().equals("MetricStatisticsProvider")) {
        MetricRegistry registry = ((MetricStatisticsProvider) statisticsProvider).getRegistry();
        indexUpdate.setTraversalRateEstimator(new MetricRateEstimator(name, registry));
    }
    NodeCounterMBeanEstimator estimator = new NodeCounterMBeanEstimator(store);
    indexUpdate.setNodeCountEstimator(estimator);
}
Also used : MetricRegistry(com.codahale.metrics.MetricRegistry) MetricRateEstimator(org.apache.jackrabbit.oak.plugins.index.progress.MetricRateEstimator) MetricStatisticsProvider(org.apache.jackrabbit.oak.plugins.metric.MetricStatisticsProvider) NodeCounterMBeanEstimator(org.apache.jackrabbit.oak.plugins.index.progress.NodeCounterMBeanEstimator)

Aggregations

MetricRegistry (com.codahale.metrics.MetricRegistry)2 MetricRateEstimator (org.apache.jackrabbit.oak.plugins.index.progress.MetricRateEstimator)2 NodeCounterMBeanEstimator (org.apache.jackrabbit.oak.plugins.index.progress.NodeCounterMBeanEstimator)2 MetricStatisticsProvider (org.apache.jackrabbit.oak.plugins.metric.MetricStatisticsProvider)2 StatisticsProvider (org.apache.jackrabbit.oak.stats.StatisticsProvider)1