use of com.yahoo.processing.execution.Execution.Trace in project vespa by vespa-engine.
the class FastSearcherTestCase method getTraceString.
private String getTraceString(String summary) {
FastSearcher fastSearcher = createFastSearcher();
Query query = new Query("?query=ignored");
query.getPresentation().setSummary(summary);
query.setTraceLevel(2);
Result result = doSearch(fastSearcher, query, 0, 10);
doFill(fastSearcher, result);
Trace trace = query.getContext(false).getTrace();
final AtomicReference<String> fillTraceString = new AtomicReference<>();
trace.traceNode().accept(new TraceVisitor() {
@Override
public void visit(TraceNode traceNode) {
if (traceNode.payload() instanceof String && traceNode.payload().toString().contains("fill to dispatch"))
fillTraceString.set((String) traceNode.payload());
}
});
return fillTraceString.get();
}
use of com.yahoo.processing.execution.Execution.Trace in project vespa by vespa-engine.
the class JSONDebugSearcherTestCase method test.
@Test
public final void test() {
Execution e = new Execution(searchChain, Execution.Context.createContextStub());
e.search(new Query(NODUMPJSON));
Trace t = e.trace();
LookForJson visitor = new LookForJson();
t.accept(visitor);
assertEquals(false, visitor.gotJson);
e = new Execution(searchChain, Execution.Context.createContextStub());
e.search(new Query(DUMPJSON));
t = e.trace();
t.accept(visitor);
assertEquals(true, visitor.gotJson);
}
Aggregations