-
Notifications
You must be signed in to change notification settings - Fork 270
Add container stats method #108
Conversation
|
"At some point" yes but right now this should be sufficient. It's missing docs and tests though :) |
|
@ubermuda Added. However there is an issue with /**
* @Route("/docker/{containerId}/stats", name="docker_stats")
*/
public function statsAction($containerId)
{
/** @var Docker $docker */
$docker = $this->get('docker');
$container = new Container();
$container->setId($containerId);
$containerManager = $docker->getContainerManager();
$stats = $containerManager->stats($container, true);
return new Response('<html><body><pre>'.var_export($stats, true).'</pre></body></html>');
}it works fine and returns with 10 arrays of stats after 10 seconds. But the added |
testStatsWait is not actually stopping - it works outside of PhpUnit though
|
As we can only run Docker 1.4.1 / Remote API 1.16 on Travis at the moment the tests are skipped. |
|
With Docker 1.6 on the way I hope we can update soon. The issues with Travis should be fixed now. |
|
@hacfi can you rebase this on master if you still want it merged? |
|
Will do on the weekend..will also make sure the tests run on travis - it worked with my last commit using docker 1.8.1 |
|
closed in #147 |
See http://docs.docker.com/reference/api/docker_remote_api_v1.17/#get-container-stats-based-on-resource-usage
I think if you use
$wait = truethis will run until the container stops. At some point we could try to return a stream to use the output while it’s streamed.