@Test public void deployment_fail_ratio() { var tester = new DeploymentTester(); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) .region("us-west-1") .build(); MetricsReporter metricsReporter = createReporter(tester.controller()); metricsReporter.maintain(); assertEquals(0.0, metrics.getMetric(MetricsReporter.DEPLOYMENT_FAIL_METRIC)); var context1 = tester.newDeploymentContext("app1", "tenant1", "default"); var context2 = tester.newDeploymentContext("app2", "tenant1", "default"); var context3 = tester.newDeploymentContext("app3", "tenant1", "default"); var context4 = tester.newDeploymentContext("app4", "tenant1", "default"); context1.submit(applicationPackage).deploy(); context2.submit(applicationPackage).deploy(); context3.submit(applicationPackage).deploy(); context4.submit(applicationPackage).deploy(); metricsReporter.maintain(); assertEquals(0.0, metrics.getMetric(MetricsReporter.DEPLOYMENT_FAIL_METRIC)); context1.submit(applicationPackage) .triggerJobs() .failDeployment(systemTest); metricsReporter.maintain(); assertEquals(25.0, metrics.getMetric(MetricsReporter.DEPLOYMENT_FAIL_METRIC)); }
@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; }