Search in sources :

Example 61 with ComponentId

use of com.yahoo.component.ComponentId 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 62 with ComponentId

use of com.yahoo.component.ComponentId 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 63 with ComponentId

use of com.yahoo.component.ComponentId 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)

Example 64 with ComponentId

use of com.yahoo.component.ComponentId in project vespa by vespa-engine.

the class OverrideTestCase method setUp.

@Override
protected void setUp() {
    type = new QueryProfileType(new ComponentId("testtype"));
    user = new QueryProfileType(new ComponentId("user"));
    registry = new QueryProfileTypeRegistry();
    registry.register(type);
    registry.register(user);
    addTypeFields(type);
    addUserFields(user);
}
Also used : QueryProfileTypeRegistry(com.yahoo.search.query.profile.types.QueryProfileTypeRegistry) QueryProfileType(com.yahoo.search.query.profile.types.QueryProfileType) ComponentId(com.yahoo.component.ComponentId)

Example 65 with ComponentId

use of com.yahoo.component.ComponentId in project vespa by vespa-engine.

the class QueryProfileTypeInheritanceTestCase method setUp.

@Override
protected void setUp() {
    type = new QueryProfileType(new ComponentId("testtype"));
    typeStrict = new QueryProfileType(new ComponentId("testtypeStrict"));
    typeStrict.setStrict(true);
    user = new QueryProfileType(new ComponentId("user"));
    userStrict = new QueryProfileType(new ComponentId("userStrict"));
    userStrict.setStrict(true);
    registry = new QueryProfileTypeRegistry();
    registry.register(type);
    registry.register(typeStrict);
    registry.register(user);
    registry.register(userStrict);
    addTypeFields(type);
    type.addField(new FieldDescription("myUserQueryProfile", FieldType.fromString("query-profile:user", registry)));
    addTypeFields(typeStrict);
    typeStrict.addField(new FieldDescription("myUserQueryProfile", FieldType.fromString("query-profile:userStrict", registry)));
    addUserFields(user);
    addUserFields(userStrict);
}
Also used : QueryProfileTypeRegistry(com.yahoo.search.query.profile.types.QueryProfileTypeRegistry) QueryProfileType(com.yahoo.search.query.profile.types.QueryProfileType) ComponentId(com.yahoo.component.ComponentId) FieldDescription(com.yahoo.search.query.profile.types.FieldDescription)

Aggregations

ComponentId (com.yahoo.component.ComponentId)68 Test (org.junit.Test)25 Result (com.yahoo.search.Result)14 Query (com.yahoo.search.Query)13 Execution (com.yahoo.search.searchchain.Execution)13 ArrayList (java.util.ArrayList)10 Chain (com.yahoo.component.chain.Chain)8 Searcher (com.yahoo.search.Searcher)8 ComponentRegistry (com.yahoo.component.provider.ComponentRegistry)7 QueryProfileType (com.yahoo.search.query.profile.types.QueryProfileType)7 FederationSearcher (com.yahoo.search.federation.FederationSearcher)6 Hit (com.yahoo.search.result.Hit)6 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)6 DomBuilderTest (com.yahoo.config.model.builder.xml.test.DomBuilderTest)4 ChainsConfig (com.yahoo.container.core.ChainsConfig)4 FilterChainRepository (com.yahoo.container.http.filter.FilterChainRepository)4 FieldDescription (com.yahoo.search.query.profile.types.FieldDescription)4 QueryProfileTypeRegistry (com.yahoo.search.query.profile.types.QueryProfileTypeRegistry)4 Component (com.yahoo.vespa.model.container.component.Component)4 HashMap (java.util.HashMap)4