@SuppressWarnings("ResultOfMethodCallIgnored") @Test public void canExperiment () { doReturn(1D).when(platform).getDestructionProbability(); assertTrue(testContainer2.canExperiment()); doReturn(0D).when(platform).getDestructionProbability(); assertFalse(testContainer2.canExperiment()); }
@Override public boolean canExperiment () { if (new Random().nextDouble() < getPlatform().getDestructionProbability()) { return eligibleForExperiments(); } log.debug("Cannot experiment on the container right now", v(DataDogConstants.DATADOG_CONTAINER_KEY, this)); return false; }
Container implements ExperimentalObject { @Override public boolean canExperiment () { if (new Random().nextDouble() < getPlatform().getDestructionProbability()) { return eligibleForExperiments(); } log.debug("Cannot experiment on the container right now", v(DataDogConstants.DATADOG_CONTAINER_KEY, this)); return false; } }
Container implements ExperimentalObject { @Override public boolean canExperiment () { if (new Random().nextDouble() < getPlatform().getDestructionProbability()) { return eligibleForExperiments(); } log.debug("Cannot experiment on the container right now", v(DataDogConstants.DATADOG_CONTAINER_KEY, this)); return false; }  }
Container implements ExperimentalObject { @Override public boolean canExperiment () { if (new Random().nextDouble() < getPlatform().getDestructionProbability()) { return eligibleForExperiments(); } log.debug("Cannot experiment on the container right now", v(DataDogConstants.DATADOG_CONTAINER_KEY, this)); return false; }  Map<String, Boolean> getShellCapabilities(); @JsonIgnore Map<String, String> getDataDogTags(); @Override boolean canExperiment(); @JsonIgnore abstract Platform getPlatform(); boolean eligibleForExperiments(); Experiment createExperiment(); @Override boolean equals(Object o); @Override int hashCode(); long getIdentity(); @Override String toString(); ContainerHealth getContainerHealth(ExperimentType experimentType); Experiment createExperiment(String experimentMethod); void startExperiment(Experiment experiment); abstract String getSimpleName(); abstract String getAggregationIdentifier(); String getContainerType(); @JsonIgnore Duration getMinimumSelfHealingInterval(); @JsonIgnore abstract DataDogIdentifier getDataDogIdentifier(); boolean compareUniqueIdentifier(String uniqueIdentifier); void setMappedDiagnosticContext(); void clearMappedDiagnosticContext(); @JsonIgnore List<Method> getExperimentMethods(); @SuppressWarnings("unchecked") Runnable recycleCattle(); boolean isCattle(); boolean supportsShellBasedExperiments(); @SuppressWarnings("unchecked") ShellOutput runCommand(String command); @JsonIgnore Boolean isContainerRecycled(); @SuppressWarnings("unchecked") String runScript(Script script); Instant getExperimentStartTime(); Collection<String> getKnownMissingCapabilities(); void clearExperiment(); boolean supportsExperimentScope(ExperimentScope experimentScope); }
Container implements ExperimentalObject { @Override public boolean canExperiment () { if (new Random().nextDouble() < getPlatform().getDestructionProbability()) { return eligibleForExperiments(); } log.debug("Cannot experiment on the container right now", v(DataDogConstants.DATADOG_CONTAINER_KEY, this)); return false; }  Map<String, Boolean> getShellCapabilities(); @JsonIgnore Map<String, String> getDataDogTags(); @Override boolean canExperiment(); @JsonIgnore abstract Platform getPlatform(); boolean eligibleForExperiments(); Experiment createExperiment(); @Override boolean equals(Object o); @Override int hashCode(); long getIdentity(); @Override String toString(); ContainerHealth getContainerHealth(ExperimentType experimentType); Experiment createExperiment(String experimentMethod); void startExperiment(Experiment experiment); abstract String getSimpleName(); abstract String getAggregationIdentifier(); String getContainerType(); @JsonIgnore Duration getMinimumSelfHealingInterval(); @JsonIgnore abstract DataDogIdentifier getDataDogIdentifier(); boolean compareUniqueIdentifier(String uniqueIdentifier); void setMappedDiagnosticContext(); void clearMappedDiagnosticContext(); @JsonIgnore List<Method> getExperimentMethods(); @SuppressWarnings("unchecked") Runnable recycleCattle(); boolean isCattle(); boolean supportsShellBasedExperiments(); @SuppressWarnings("unchecked") ShellOutput runCommand(String command); @JsonIgnore Boolean isContainerRecycled(); @SuppressWarnings("unchecked") String runScript(Script script); Instant getExperimentStartTime(); Collection<String> getKnownMissingCapabilities(); void clearExperiment(); boolean supportsExperimentScope(ExperimentScope experimentScope);  }