@Override public void pulling() { pullContext = metrics.containerPull(); }
@Override public void failed(final Throwable th, final String containerError) { metrics.containersThrewException(); }
@Override public void run() { final double timeoutRatio = fiveMinuteRatio( metrics.getDockerTimeoutRates(), metrics.getSupervisorRunRates()); final double exceptionRatio = fiveMinuteRatio( metrics.getContainersThrewExceptionRates(), metrics.getSupervisorRunRates()); if (timeoutRatio > 0 || exceptionRatio > 0) { log.info("timeout ratio is {}, exception ratio is {}", timeoutRatio, exceptionRatio); } // Yay hysteresis! if (timeoutRatio > FAILURE_HIGH_WATERMARK) { reason = "docker timeouts are too high for too long"; } if (exceptionRatio > FAILURE_HIGH_WATERMARK) { reason = "supervisor run exception frequency is too high"; } if (timeoutRatio < FAILURE_LOW_WATERMARK && exceptionRatio < FAILURE_LOW_WATERMARK) { reason = null; } } }
@SuppressWarnings("MissingSwitchDefault") public void setGoal(final Goal goal) { if (this.goal == goal) { return; } log.debug("Supervisor {}: setting goal: {}", job.getId(), goal); this.goal = goal; statusUpdater.setGoal(goal); switch (goal) { case START: currentCommand = new Start(); reactor.signal(); metrics.supervisorStarted(); break; case STOP: case UNDEPLOY: currentCommand = new Stop(); reactor.signal(); metrics.supervisorStopped(); break; } }
/** * Close this supervisor. The actual container is left as-is. */ public void close() { reactor.stopAsync(); if (runner != null) { runner.stopAsync(); } metrics.supervisorClosed(); monitor.close(); }
public void setGoal(final Goal goal) { if (this.goal == goal) { return; } log.debug("Supervisor {}: setting goal: {}", job.getId(), goal); this.goal = goal; statusUpdater.setGoal(goal); switch (goal) { case START: currentCommand = new Start(); reactor.signal(); metrics.supervisorStarted(); break; case STOP: case UNDEPLOY: currentCommand = new Stop(); reactor.signal(); metrics.supervisorStopped(); break; } }
/** * Close this supervisor. The actual container is left as-is. */ public void close() { reactor.stopAsync(); if (runner != null) { runner.stopAsync(); } metrics.supervisorClosed(); monitor.close(); }
@Override public void run() { final double timeoutRatio = fiveMinuteRatio( metrics.getDockerTimeoutRates(), metrics.getSupervisorRunRates()); final double exceptionRatio = fiveMinuteRatio( metrics.getContainersThrewExceptionRates(), metrics.getSupervisorRunRates()); if (timeoutRatio > 0 || exceptionRatio > 0) { log.info("timeout ratio is {}, exception ratio is {}", timeoutRatio, exceptionRatio);
@Override public void pulling() { pullContext = metrics.containerPull(); }
@Override public void failed(final Throwable t) { metrics.containersThrewException(); }