use of io.crate.execution.jobs.InstrumentedIndexSearcher in project crate by crate.
the class TransportJobAction method maybeInstrumentProfiler.
private SharedShardContexts maybeInstrumentProfiler(boolean enableProfiling, RootTask.Builder contextBuilder) {
if (enableProfiling) {
var profilers = new ArrayList<QueryProfiler>();
ProfilingContext profilingContext = new ProfilingContext(profilers);
contextBuilder.profilingContext(profilingContext);
return new SharedShardContexts(indicesService, indexSearcher -> {
var queryProfiler = new QueryProfiler();
profilers.add(queryProfiler);
return new InstrumentedIndexSearcher(indexSearcher, queryProfiler);
});
} else {
return new SharedShardContexts(indicesService, UnaryOperator.identity());
}
}
use of io.crate.execution.jobs.InstrumentedIndexSearcher in project crate by crate.
the class JobLauncher method maybeInstrumentProfiler.
private SharedShardContexts maybeInstrumentProfiler(RootTask.Builder builder) {
if (enableProfiling) {
var profilers = new ArrayList<QueryProfiler>();
ProfilingContext profilingContext = new ProfilingContext(profilers);
builder.profilingContext(profilingContext);
return new SharedShardContexts(indicesService, indexSearcher -> {
var queryProfiler = new QueryProfiler();
profilers.add(queryProfiler);
return new InstrumentedIndexSearcher(indexSearcher, queryProfiler);
});
} else {
return new SharedShardContexts(indicesService, UnaryOperator.identity());
}
}
Aggregations