diff --git a/CHANGELOG.md b/CHANGELOG.md index 7092a1f..0c2ef1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.4.0 | 2019-05-11 | `dockerContainers()` added started, finished time | | 4.3.0 | 2019-05-09 | `dockerContainers()` `dockerStats()` added restartCount | | 4.2.1 | 2019-05-09 | `networkInterfaceDefault()` time delay fix (linux) | | 4.2.0 | 2019-05-09 | `osInfo()` extended service pack version (windows) | diff --git a/README.md b/README.md index 7dedb8b..236ff97 100644 --- a/README.md +++ b/README.md @@ -82,13 +82,13 @@ si.cpu() (last 7 major and minor version releases) +- Version 4.4.0: `dockerContainers()` added started, finished time - Version 4.3.0: `dockerContainers()` `dockerStats()` added restartCount - Version 4.2.0: `networkInterfaceDefault()` time delay fix (linux) - Version 4.1.0: `versions()` added python3, pip, pip3, java - Version 4.0.0: new version ... read the [detailed changelog][changelog-url] to see all breaking changes - Version 3.54.0: added TypeScript type definitions - Version 3.53.0: `versions()` added perl, python, gcc -- Version 3.52.0: `cpu()` added physical cores, processors, socket type - ... You can find all changes here: [detailed changelog][changelog-url] diff --git a/docs/docker.html b/docs/docker.html index e3b8eba..ff885cd 100644 --- a/docs/docker.html +++ b/docs/docker.html @@ -133,7 +133,57 @@ X X X - creation time + creation time (unix time) + + + + [0].started + X + X + X + X + X + started time (unix time) + + + + [0].finished + X + X + X + X + X + finished time (unix time) + + + + [0].createdAt + X + X + X + X + X + creation date time string + + + + [0].startedAt + X + X + X + X + X + creation date time string + + + + [0].finishedAt + X + X + X + X + X + creation date time string diff --git a/docs/history.html b/docs/history.html index 9ef4fb9..d111b9b 100644 --- a/docs/history.html +++ b/docs/history.html @@ -80,6 +80,11 @@ + + 4.4.0 + 2019-05-09 + dockerContainers() added started, finished time + 4.3.0 2019-05-09 diff --git a/docs/index.html b/docs/index.html index d823538..b110bb8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
systeminformation
-
Current Version: 4.3.0
+
Current Version: 4.4.0
@@ -193,7 +193,7 @@
-
8,354
+
8,351
Lines of code
@@ -201,7 +201,7 @@
Downloads last month
-
154
+
157
Dependends
diff --git a/lib/docker.js b/lib/docker.js index 3934b41..c29c168 100644 --- a/lib/docker.js +++ b/lib/docker.js @@ -120,14 +120,6 @@ function dockerContainers(all, callback) { function dockerContainerInspect(containerID, payload) { containerID = containerID || ''; - let result = { - id: containerID, - mem_usage: 0, - mem_limit: 0, - mem_percent: 0, - cpu_percent: 0, - pids: 0, - }; return new Promise((resolve) => { process.nextTick(() => { if (containerID) { @@ -151,6 +143,11 @@ function dockerContainerInspect(containerID, payload) { imageID: payload.ImageID, command: payload.Command, created: payload.Created, + started: data.State && data.State.StartedAt ? Math.round(new Date(data.State.StartedAt).getTime() / 1000) : 0, + finished: data.State && data.State.FinishedAt && !data.State.FinishedAt.startsWith('0001-01-01') ? Math.round(new Date(data.State.FinishedAt).getTime() / 1000) : 0, + createdAt: data.Created ? data.Created : '', + startedAt: data.State && data.State.StartedAt ? data.State.StartedAt : '', + finishedAt: data.State && data.State.FinishedAt && !data.State.FinishedAt.startsWith('0001-01-01') ? data.State.FinishedAt : '', state: payload.State, restartCount: data.RestartCount || 0, platform: data.Platform || '', @@ -159,7 +156,7 @@ function dockerContainerInspect(containerID, payload) { mounts: payload.Mounts, // hostconfig: payload.HostConfig, // network: payload.NetworkSettings - }) + }); } catch (err) { resolve(); } diff --git a/lib/index.d.ts b/lib/index.d.ts index 4c69072..f8c0442 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -421,6 +421,11 @@ export namespace Systeminformation { imageID: string; command: string; created: number; + started: number; + finished: number; + createdAt: string; + startedAt: string; + finishedAt: string; state: string; restartCount: number; platform: string;