Better OOM notification messages

This commit is contained in:
Girish Ramakrishnan
2019-03-06 11:54:37 -08:00
parent 916ca87db4
commit b5a4121574
5 changed files with 72 additions and 36 deletions

View File

@@ -22,6 +22,7 @@ exports = module.exports = {
getContainerIdByIp: getContainerIdByIp,
inspect: inspect,
inspectByName: inspect,
getEvents: getEvents,
memoryUsage: memoryUsage,
execContainer: execContainer,
createVolume: createVolume,
@@ -474,6 +475,19 @@ function inspect(containerId, callback) {
});
}
function getEvents(options, callback) {
assert.strictEqual(typeof options, 'object');
assert.strictEqual(typeof callback, 'function');
let docker = exports.connection;
docker.getEvents(options, function (error, stream) {
if (error) return callback(new DockerError(DockerError.INTERNAL_ERROR, error));
callback(null, stream);
});
}
function memoryUsage(containerId, callback) {
assert.strictEqual(typeof containerId, 'string');
assert.strictEqual(typeof callback, 'function');