Search in sources :

Example 6 with SearcherTimer

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);
}
Also used : Chain(com.yahoo.component.chain.Chain) Execution(com.yahoo.search.searchchain.Execution) Query(com.yahoo.search.Query) SearcherTimer(com.yahoo.search.statistics.TimeTracker.SearcherTimer) Result(com.yahoo.search.Result)

Example 7 with SearcherTimer

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));
}
Also used : TimeTracker(com.yahoo.search.statistics.TimeTracker) Searcher(com.yahoo.search.Searcher) SearcherTimer(com.yahoo.search.statistics.TimeTracker.SearcherTimer)

Aggregations

SearcherTimer (com.yahoo.search.statistics.TimeTracker.SearcherTimer)7 Searcher (com.yahoo.search.Searcher)4 TimeTracker (com.yahoo.search.statistics.TimeTracker)4 Chain (com.yahoo.component.chain.Chain)2 Query (com.yahoo.search.Query)2 Execution (com.yahoo.search.searchchain.Execution)2 Result (com.yahoo.search.Result)1 LinkedHashMap (java.util.LinkedHashMap)1