diff --git a/lib/container.js b/lib/container.js index 892a0fb..027d94e 100644 --- a/lib/container.js +++ b/lib/container.js @@ -521,7 +521,7 @@ Container.prototype.logs = function(opts, callback) { * @param {Object} opts Stats options. (optional) * @param {Function} callback Callback with data */ -Container.prototype.stats = function(opts, callback) { +Container.prototype.stats = function(callback) { var optsf = { path: '/containers/' + this.id + '/stats?', method: 'GET', @@ -531,7 +531,7 @@ Container.prototype.stats = function(opts, callback) { 404: "no such container", 500: "server error" }, - options: opts + options: {} }; this.modem.dial(optsf, function(err, data) { diff --git a/package.json b/package.json index aa95ba8..0dc269b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dockerode", "description": "Docker Remote API client.", - "version": "2.0.6", + "version": "2.0.7", "author": "Pedro Dias ", "maintainers": [ "apocas " diff --git a/test/container.js b/test/container.js index 2c59649..e5cbabf 100644 --- a/test/container.js +++ b/test/container.js @@ -70,6 +70,18 @@ describe("#container", function() { }); }); + describe("#stats", function() { + it("should get container stats", function(done) { + var container = docker.getContainer(testContainer); + + container.stats(function(err, stream) { + expect(err).to.be.null; + expect(stream.pipe).to.be.ok; + done(); + }); + }); + }); + describe("#attach", function() { var optsc = { 'Hostname': '',