Skip to content

Instantly share code, notes, and snippets.

@slnowak
Created June 10, 2015 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slnowak/a9e26daaa566310b1cd4 to your computer and use it in GitHub Desktop.
Save slnowak/a9e26daaa566310b1cd4 to your computer and use it in GitHub Desktop.
@Component
public class FancyClass {
private final DockerClient dockerClient;
@Autowired
public FancyClass(DockerClient dockerClient) {
this.dockerClient = dockerClient;
}
@PostConstruct
private void doSth() {
dockerClient
.statsCmd(new StatsCallback() {
@Override
public void onStats(Statistics stats) {
System.out.println(stats.getMemoryStats());
}
@Override
public void onException(Throwable throwable) {
}
@Override
public void onCompletion(int numStats) {
System.out.println("something happen " + numStats);
}
@Override
public boolean isReceiving() {
return true;
}
})
.withContainerId("94cdd5d7715be407884a82e0f4d8ef0816efb9b367d5fd88784b5a71a46e6b3d")
.exec();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment