@Test public void deployment_average_duration() { var tester = new DeploymentTester(); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) .region("us-west-1") .build(); MetricsReporter reporter = createReporter(tester.controller()); var context = tester.newDeploymentContext() .submit(applicationPackage) .deploy(); reporter.maintain(); assertEquals(Duration.ZERO, getAverageDeploymentDuration(context.instanceId())); context.submit(applicationPackage); tester.triggerJobs(); tester.clock().advance(Duration.ofHours(1)); context.runJob(systemTest); tester.clock().advance(Duration.ofMinutes(30)); context.runJob(stagingTest); tester.triggerJobs(); tester.clock().advance(Duration.ofMinutes(90)); context.runJob(productionUsWest1); reporter.maintain(); assertEquals(Duration.ofMinutes(80), getAverageDeploymentDuration(context.instanceId())); context.submit(applicationPackage) .triggerJobs(); tester.clock().advance(Duration.ofHours(12)); reporter.maintain(); assertEquals(Duration.ofHours(12) .plus(Duration.ofHours(12)) .plus(Duration.ofMinutes(90)) .dividedBy(3), getAverageDeploymentDuration(context.instanceId())); }
@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; }