diff options
author | Håkon Hallingstad <hakon@oath.com> | 2018-12-06 14:38:57 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@oath.com> | 2018-12-06 14:38:57 +0100 |
commit | 790f43668c9f6a1ed0e86cfec730a76c31666cf6 (patch) | |
tree | 1726ce9fae98dd7f2c533733d69f0458d96cf8af /service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java | |
parent | 0daac4e48cea934f1849d5be486c8506641214b6 (diff) |
Make service monitors aware of infra applications in duper model.
- Notify monitors of infrastructure application activation. Live-flipping the
content of the duper model is non-trivial and has been removed.
- Split out DuperModel as a simple mutable and thread-unsafe container of the
applications in the duper model, that also handles calls listeners on
changes. The previous DuperModel has been renamed to DuperModelManager.
- Replace SuperModelProvider::snapshot method (fast but difficult to use
right) with registerListener.
- Shorten the fully qualified package names by 1-2 levels for mosts classes.
Next steps:
- Make HA query the real orchestrator
- Start experimenting with health monitoring of infra apps
Diffstat (limited to 'service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java')
-rw-r--r-- | service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java b/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java new file mode 100644 index 00000000000..0b9d7e123b5 --- /dev/null +++ b/service-monitor/src/test/java/com/yahoo/vespa/service/health/HealthMonitorManagerTest.java @@ -0,0 +1,34 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.service.health; + +import com.yahoo.config.model.api.ApplicationInfo; +import com.yahoo.vespa.applicationmodel.ClusterId; +import com.yahoo.vespa.applicationmodel.ConfigId; +import com.yahoo.vespa.applicationmodel.ServiceStatus; +import com.yahoo.vespa.applicationmodel.ServiceType; +import com.yahoo.vespa.service.duper.ZoneApplication; +import com.yahoo.vespa.service.monitor.ConfigserverUtil; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class HealthMonitorManagerTest { + @Test + public void addRemove() { + HealthMonitorManager manager = new HealthMonitorManager(); + ApplicationInfo applicationInfo = ConfigserverUtil.makeExampleConfigServer(); + manager.applicationActivated(applicationInfo); + manager.applicationRemoved(applicationInfo.getApplicationId()); + } + + @Test + public void withHostAdmin() { + HealthMonitorManager manager = new HealthMonitorManager(); + ServiceStatus status = manager.getStatus( + ZoneApplication.ZONE_APPLICATION_ID, + ClusterId.NODE_ADMIN, + ServiceType.CONTAINER, + new ConfigId("config-id-1")); + assertEquals(ServiceStatus.UP, status); + } +}
\ No newline at end of file |