class ContainerWatchdog implements ContainerWatchdogMetrics, AutoCloseable {

    void onContainerActivation(ActiveContainer nextContainer) {
        synchronized (monitor) {
            if (currentContainer != null) {
                deactivatedContainers.add(
                        new DeactivatedContainer(currentContainer, currentContainerActivationTime, clock.instant()));
            }
            currentContainer = nextContainer;
            currentContainerActivationTime = clock.instant();
        }
    }

      ContainerWatchdog();
      ContainerWatchdog(ScheduledExecutorService scheduler, Clock clock);

}