From 5e7687b8b4bc2b6d57fd6a9f0d67386885add3bb Mon Sep 17 00:00:00 2001 From: "budleigh@vantage" Date: Thu, 3 Mar 2022 14:15:32 +0100 Subject: [PATCH 1/3] Add system info --- samples/system-info/index.js | 15 +++++++++++++++ samples/system-info/package.json | 13 +++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 samples/system-info/index.js create mode 100644 samples/system-info/package.json diff --git a/samples/system-info/index.js b/samples/system-info/index.js new file mode 100644 index 0000000..07abf63 --- /dev/null +++ b/samples/system-info/index.js @@ -0,0 +1,15 @@ +const os = require("os"); + +module.exports = async function*(_timeout) { + const timeout = +_timeout || 1000; + console.log({timeout}); + + while (true) { + const next = new Promise(res => setTimeout(res, timeout)); + yield { + ts: Date.now(), + mem: os.freemem() + } + await next; + } +} diff --git a/samples/system-info/package.json b/samples/system-info/package.json new file mode 100644 index 0000000..cbb5ae8 --- /dev/null +++ b/samples/system-info/package.json @@ -0,0 +1,13 @@ +{ + "name": "@scramjet/system-info", + "version": "0.18.1", + "description": "Sequence that outputs a stream of system information from any server.", + "main": "./index.js", + "author": "Scramjet ", + "license": "GPL-3.0", + "repository": { + "type": "git", + "url": "https://github.com/scramjetorg/transform-hub.git" + } + } + \ No newline at end of file From 4d6768f71d706d55efd5f2fc0d899fcd62171eae Mon Sep 17 00:00:00 2001 From: "budleigh@vantage" Date: Thu, 3 Mar 2022 14:51:24 +0100 Subject: [PATCH 2/3] Fixes for 0.18.0 --- samples/system-info/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/system-info/package.json b/samples/system-info/package.json index cbb5ae8..a28efb9 100644 --- a/samples/system-info/package.json +++ b/samples/system-info/package.json @@ -1,6 +1,6 @@ { "name": "@scramjet/system-info", - "version": "0.18.1", + "version": "0.18.0", "description": "Sequence that outputs a stream of system information from any server.", "main": "./index.js", "author": "Scramjet ", From 6ef5e52d1b7ec9c28ac8430bdcc0022c7c73dc6a Mon Sep 17 00:00:00 2001 From: Budleigh Date: Thu, 10 Mar 2022 10:51:45 +0000 Subject: [PATCH 3/3] Small sample fix --- samples/system-info/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/system-info/index.js b/samples/system-info/index.js index 07abf63..0a12888 100644 --- a/samples/system-info/index.js +++ b/samples/system-info/index.js @@ -1,12 +1,13 @@ const os = require("os"); -module.exports = async function*(_timeout) { +module.exports = async function*(input, _timeout) { const timeout = +_timeout || 1000; console.log({timeout}); while (true) { const next = new Promise(res => setTimeout(res, timeout)); yield { + type: "basic", ts: Date.now(), mem: os.freemem() }