@Test public void platform_change_duration() { var tester = new ControllerTester(); var reporter = createReporter(tester.controller()); var zone = ZoneId.from("prod.eu-west-1"); tester.zoneRegistry().setUpgradePolicy(UpgradePolicy.create().upgrade(ZoneApiMock.from(zone))); var systemUpgrader = new SystemUpgrader(tester.controller(), Duration.ofDays(1) ); tester.configServer().bootstrap(List.of(zone), SystemApplication.configServer); var version0 = Version.fromString("7.0"); tester.upgradeSystem(version0); reporter.maintain(); var hosts = tester.configServer().nodeRepository().list(zone, SystemApplication.configServer.id()); assertPlatformChangeDuration(Duration.ZERO, hosts); var targets = List.of(Version.fromString("7.1"), Version.fromString("7.2")); for (int i = 0; i < targets.size(); i++) { var currentVersion = i == 0 ? version0 : targets.get(i - 1); var version = targets.get(i); tester.upgradeController(version); reporter.maintain(); assertPlatformChangeDuration(Duration.ZERO, hosts); systemUpgrader.maintain(); tester.clock().advance(Duration.ofMinutes(30)); runAll(tester::computeVersionStatus, reporter); assertPlatformChangeDuration(Duration.ZERO, hosts); assertEquals("Wanted version is raised for all nodes", version, getNodes(zone, hosts, tester).stream() .map(Node::wantedVersion) .min(Comparator.naturalOrder()) .get()); suspend(hosts, zone, tester); var firstHost = hosts.get(0); upgradeTo(version, List.of(firstHost), zone, tester); tester.clock().advance(Duration.ofHours(1)); runAll(tester::computeVersionStatus, reporter); assertPlatformChangeDuration(Duration.ZERO, List.of(firstHost)); assertPlatformChangeDuration(Duration.ofHours(1), hosts.subList(1, hosts.size())); upgradeTo(version, hosts.subList(1, hosts.size()), zone, tester); runAll(tester::computeVersionStatus, reporter); assertPlatformChangeDuration(Duration.ZERO, hosts); assertEquals(version, tester.controller().systemVersion()); assertPlatformNodeCount(hosts.size(), version); } }
@Override public boolean maintain() { reportDeploymentMetrics(); reportRemainingRotations(); reportQueuedNameServiceRequests(); reportInfrastructureUpgradeMetrics(); reportAuditLog(); return true; }
MetricsReporter extends ControllerMaintainer { @Override public boolean maintain() { reportDeploymentMetrics(); reportRemainingRotations(); reportQueuedNameServiceRequests(); reportInfrastructureUpgradeMetrics(); reportAuditLog(); return true; } }
MetricsReporter extends ControllerMaintainer { @Override public boolean maintain() { reportDeploymentMetrics(); reportRemainingRotations(); reportQueuedNameServiceRequests(); reportInfrastructureUpgradeMetrics(); reportAuditLog(); return true; } MetricsReporter(Controller controller, Metric metric); }
MetricsReporter extends ControllerMaintainer { @Override public boolean maintain() { reportDeploymentMetrics(); reportRemainingRotations(); reportQueuedNameServiceRequests(); reportInfrastructureUpgradeMetrics(); reportAuditLog(); return true; } MetricsReporter(Controller controller, Metric metric); @Override boolean maintain(); }
MetricsReporter extends ControllerMaintainer { @Override public boolean maintain() { reportDeploymentMetrics(); reportRemainingRotations(); reportQueuedNameServiceRequests(); reportInfrastructureUpgradeMetrics(); reportAuditLog(); return true; } MetricsReporter(Controller controller, Metric metric); @Override boolean maintain(); static final String DEPLOYMENT_FAIL_METRIC; static final String DEPLOYMENT_AVERAGE_DURATION; static final String DEPLOYMENT_FAILING_UPGRADES; static final String DEPLOYMENT_BUILD_AGE_SECONDS; static final String DEPLOYMENT_WARNINGS; static final String OS_CHANGE_DURATION; static final String PLATFORM_CHANGE_DURATION; static final String OS_NODE_COUNT; static final String PLATFORM_NODE_COUNT; static final String REMAINING_ROTATIONS; static final String NAME_SERVICE_REQUESTS_QUEUED; static final String OPERATION_PREFIX; }