Search in sources :

Example 1 with MetricUpdater

use of com.yahoo.vespa.config.server.monitoring.MetricUpdater in project vespa by vespa-engine.

the class ActivatedModelsBuilder method buildModelVersion.

@Override
protected Application buildModelVersion(ModelFactory modelFactory, ApplicationPackage applicationPackage, ApplicationId applicationId, com.yahoo.component.Version wantedNodeVespaVersion, // Ignored since we have this in the app package for activated models
Optional<AllocatedHosts> ignored, Instant now) {
    log.log(LogLevel.DEBUG, String.format("Loading model version %s for session %s application %s", modelFactory.getVersion(), appGeneration, applicationId));
    ServerCache cache = zkClient.loadServerCache();
    ModelContext modelContext = new ModelContextImpl(applicationPackage, Optional.empty(), permanentApplicationPackage.get().applicationPackage(), logger, configDefinitionRepo, getForVersionOrLatest(applicationPackage.getFileRegistryMap(), modelFactory.getVersion()).orElse(new MockFileRegistry()), createStaticProvisioner(applicationPackage.getAllocatedHosts()), createModelContextProperties(applicationId), Optional.empty(), new com.yahoo.component.Version(modelFactory.getVersion().toString()), wantedNodeVespaVersion);
    MetricUpdater applicationMetricUpdater = metrics.getOrCreateMetricUpdater(Metrics.createDimensions(applicationId));
    return new Application(modelFactory.createModel(modelContext), cache, appGeneration, modelFactory.getVersion(), applicationMetricUpdater, applicationId);
}
Also used : ServerCache(com.yahoo.vespa.config.server.ServerCache) ModelContext(com.yahoo.config.model.api.ModelContext) MetricUpdater(com.yahoo.vespa.config.server.monitoring.MetricUpdater) ModelContextImpl(com.yahoo.vespa.config.server.deploy.ModelContextImpl) MockFileRegistry(com.yahoo.config.model.application.provider.MockFileRegistry) Application(com.yahoo.vespa.config.server.application.Application)

Example 2 with MetricUpdater

use of com.yahoo.vespa.config.server.monitoring.MetricUpdater in project vespa by vespa-engine.

the class ApplicationTest method setupHandler.

@Before
public void setupHandler() throws IOException, SAXException {
    File testApp = new File("src/test/apps/app");
    ServerCache cache = createCacheAndAddContent();
    VespaModel model = new VespaModel(FilesApplicationPackage.fromFile(testApp));
    final ApplicationId applicationId = new ApplicationId.Builder().tenant("foo").applicationName("foo").build();
    handler = new Application(model, cache, 1, Version.fromIntValues(1, 2, 3), new MetricUpdater(Metrics.createTestMetrics(), Metrics.createDimensions(applicationId)), applicationId);
}
Also used : ServerCache(com.yahoo.vespa.config.server.ServerCache) MetricUpdater(com.yahoo.vespa.config.server.monitoring.MetricUpdater) VespaModel(com.yahoo.vespa.model.VespaModel) ApplicationId(com.yahoo.config.provision.ApplicationId) File(java.io.File) Before(org.junit.Before)

Aggregations

ServerCache (com.yahoo.vespa.config.server.ServerCache)2 MetricUpdater (com.yahoo.vespa.config.server.monitoring.MetricUpdater)2 ModelContext (com.yahoo.config.model.api.ModelContext)1 MockFileRegistry (com.yahoo.config.model.application.provider.MockFileRegistry)1 ApplicationId (com.yahoo.config.provision.ApplicationId)1 Application (com.yahoo.vespa.config.server.application.Application)1 ModelContextImpl (com.yahoo.vespa.config.server.deploy.ModelContextImpl)1 VespaModel (com.yahoo.vespa.model.VespaModel)1 File (java.io.File)1 Before (org.junit.Before)1