Search in sources :

Example 1 with Parameters

use of com.yahoo.search.statistics.TimingSearcher.Parameters in project vespa by vespa-engine.

the class TimingSearcherTestCase method testMeasurementPingPath.

public void testMeasurementPingPath() {
    Parameters p = new Parameters("timingtest", TimeTracker.Activity.PING);
    TimingSearcher ts = new TimingSearcher(new ComponentId("lblblbl"), p, Statistics.nullImplementation);
    MockValue v = new MockValue();
    ts.setMeasurements(v);
    Execution exec = new Execution(ts, Execution.Context.createContextStub());
    Result r = exec.search(new Query("/?query=a"));
    Hit f = new Hit("blblbl");
    f.setFillable();
    r.hits().add(f);
    exec.fill(r, "whatever");
    exec.fill(r, "lalala");
    exec.ping(new Ping());
    exec.ping(new Ping());
    exec.ping(new Ping());
    assertEquals(3, v.putCount);
}
Also used : Hit(com.yahoo.search.result.Hit) Parameters(com.yahoo.search.statistics.TimingSearcher.Parameters) Execution(com.yahoo.search.searchchain.Execution) Query(com.yahoo.search.Query) Ping(com.yahoo.prelude.Ping) ComponentId(com.yahoo.component.ComponentId) Result(com.yahoo.search.Result)

Example 2 with Parameters

use of com.yahoo.search.statistics.TimingSearcher.Parameters in project vespa by vespa-engine.

the class TimingSearcherTestCase method testMeasurementSearchPath.

public void testMeasurementSearchPath() {
    Parameters p = new Parameters("timingtest", TimeTracker.Activity.SEARCH);
    TimingSearcher ts = new TimingSearcher(new ComponentId("lblblbl"), p, Statistics.nullImplementation);
    MockValue v = new MockValue();
    ts.setMeasurements(v);
    Execution exec = new Execution(ts, Execution.Context.createContextStub());
    Result r = exec.search(new Query("/?query=a"));
    Hit f = new Hit("blblbl");
    f.setFillable();
    r.hits().add(f);
    exec.fill(r, "whatever");
    exec.fill(r, "lalala");
    exec.ping(new Ping());
    exec.ping(new Ping());
    exec.ping(new Ping());
    assertEquals(1, v.putCount);
}
Also used : Hit(com.yahoo.search.result.Hit) Parameters(com.yahoo.search.statistics.TimingSearcher.Parameters) Execution(com.yahoo.search.searchchain.Execution) Query(com.yahoo.search.Query) Ping(com.yahoo.prelude.Ping) ComponentId(com.yahoo.component.ComponentId) Result(com.yahoo.search.Result)

Example 3 with Parameters

use of com.yahoo.search.statistics.TimingSearcher.Parameters in project vespa by vespa-engine.

the class TimingSearcherTestCase method testMeasurementFillPath.

public void testMeasurementFillPath() {
    Parameters p = new Parameters("timingtest", TimeTracker.Activity.FILL);
    TimingSearcher ts = new TimingSearcher(new ComponentId("lblblbl"), p, Statistics.nullImplementation);
    MockValue v = new MockValue();
    ts.setMeasurements(v);
    Execution exec = new Execution(ts, Execution.Context.createContextStub());
    Result r = exec.search(new Query("/?query=a"));
    Hit f = new Hit("blblbl");
    f.setFillable();
    r.hits().add(f);
    exec.fill(r, "whatever");
    exec.fill(r, "lalala");
    exec.ping(new Ping());
    exec.ping(new Ping());
    exec.ping(new Ping());
    assertEquals(2, v.putCount);
}
Also used : Hit(com.yahoo.search.result.Hit) Parameters(com.yahoo.search.statistics.TimingSearcher.Parameters) Execution(com.yahoo.search.searchchain.Execution) Query(com.yahoo.search.Query) Ping(com.yahoo.prelude.Ping) ComponentId(com.yahoo.component.ComponentId) Result(com.yahoo.search.Result)

Aggregations

ComponentId (com.yahoo.component.ComponentId)3 Ping (com.yahoo.prelude.Ping)3 Query (com.yahoo.search.Query)3 Result (com.yahoo.search.Result)3 Hit (com.yahoo.search.result.Hit)3 Execution (com.yahoo.search.searchchain.Execution)3 Parameters (com.yahoo.search.statistics.TimingSearcher.Parameters)3