use of com.yahoo.yolean.trace.TraceVisitor 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();
}
Aggregations