use of com.yahoo.search.statistics.TimeTracker.SearcherTimer in project vespa by vespa-engine.
the class ElapsedTimeTestCase method testBasicBreakdownWithFillFullyWiredIn.
public void testBasicBreakdownWithFillFullyWiredIn() {
Chain<? extends Searcher> chain = new Chain<>(new UselessSearcher("first"), new UselessSearcher("second"), new AlmostUselessSearcher("third"));
Execution exec = new Execution(chain, Execution.Context.createContextStub());
exec.timer().injectTimeSource(new CreativeTimeSource(SEARCH_AND_FILL_TIMESEQUENCE));
exec.context().setDetailedDiagnostics(true);
Result result = exec.search(new Query());
exec.fill(result);
SearcherTimer[] searchers = exec.timer().searcherTracking();
checkTiming(searchers);
checkFillTiming(searchers);
}
use of com.yahoo.search.statistics.TimeTracker.SearcherTimer in project vespa by vespa-engine.
the class ElapsedTimeTestCase method testBasicBreakdownWithFill.
public void testBasicBreakdownWithFill() {
TimeTracker t = new TimeTracker(new Chain<Searcher>(new UselessSearcher("first"), new UselessSearcher("second"), new UselessSearcher("third")));
t.injectTimeSource(new CreativeTimeSource(new long[] { 1L, 2L, 3L, 4L, 5L, 6L, 7L, 7L, 8L, 9L, 10L }));
t.sampleSearch(0, true);
t.sampleSearch(1, true);
t.sampleSearch(2, true);
t.sampleSearch(3, true);
t.sampleSearchReturn(2, true, null);
t.sampleSearchReturn(1, true, null);
t.sampleSearchReturn(0, true, null);
t.sampleFill(0, true);
t.sampleFill(1, true);
t.sampleFillReturn(1, true, null);
t.sampleFillReturn(0, true, null);
SearcherTimer[] searchers = t.searcherTracking();
assertEquals(Long.valueOf(1L), searchers[0].getInvoking(Activity.SEARCH));
assertEquals(Long.valueOf(1L), searchers[1].getInvoking(Activity.SEARCH));
assertEquals(Long.valueOf(1L), searchers[2].getInvoking(Activity.SEARCH));
assertEquals(Long.valueOf(1L), searchers[2].getReturning(Activity.SEARCH));
assertEquals(Long.valueOf(1L), searchers[1].getReturning(Activity.SEARCH));
assertEquals(Long.valueOf(1L), searchers[0].getReturning(Activity.SEARCH));
assertEquals(Long.valueOf(1L), searchers[0].getInvoking(Activity.FILL));
assertEquals(Long.valueOf(1L), searchers[1].getInvoking(Activity.FILL));
assertNull(searchers[1].getReturning(Activity.FILL));
assertEquals(Long.valueOf(1L), searchers[0].getReturning(Activity.FILL));
}
Aggregations