diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2018-05-07 09:22:58 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2018-05-07 09:22:58 +0200 |
| commit | 9997d9a82bdc70c5fc0b19a27f4d9cadf28e954a (patch) | |
| tree | e11560174da2aeda0a9ece7959930d64faa1d630 | |
| parent | 12aab6c56e8df4f838ddce5160b4f39a610a8954 (diff) | |
| download | brokentalents-9997d9a82bdc70c5fc0b19a27f4d9cadf28e954a.tar.gz brokentalents-9997d9a82bdc70c5fc0b19a27f4d9cadf28e954a.zip | |
save output as report
| -rw-r--r-- | backend/config.js | 1 | ||||
| -rw-r--r-- | backend/index.js | 5 | ||||
| m--------- | data | 0 | ||||
| -rw-r--r-- | package-lock.json | 58 |
4 files changed, 50 insertions, 14 deletions
diff --git a/backend/config.js b/backend/config.js index fe51ca3..cecbe05 100644 --- a/backend/config.js +++ b/backend/config.js @@ -55,5 +55,6 @@ module.exports = { }, file: { pattern: (moment) => `../data/${hashSettings(module.exports)}/${moment.toISOString()}.json`, + reportPattern: () => `../data/${hashSettings(module.exports)}/report.json`, }, }; diff --git a/backend/index.js b/backend/index.js index 5da0f82..0befe86 100644 --- a/backend/index.js +++ b/backend/index.js @@ -5,22 +5,25 @@ const R = require('ramda'), moment = require('moment'), reduce = require('./reduce'), source = require('./source'), + file = require('./file'), config = require('./config'); const loadFTimestamped = source.loadFTimestamped(config); const deriveStatistics = reduce.deriveStatistics(config.reduce); const aggregatePayloads = reduce.aggregatePayloads(config.reduce); +const saveFPayloads = file.saveFPayloads(config.file); function main() { const firstOfMay = moment('2018-05-01'); const later = R.curry((base, hs) => base.clone().add(hs, 'hours')); - const hours = R.range(0, 24 * 5); + const hours = R.range(0, 24 * 5 + 20); const laterMoments = R.map(later(firstOfMay), hours); const futures = R.map(loadFTimestamped, laterMoments); Future.parallel(1, futures) .map(R.compose(deriveStatistics, aggregatePayloads, R.unnest)) + .chain(saveFPayloads(config.file.reportPattern())) .fork(console.error, (d) => console.log(JSON.stringify(d, null, 2))); } diff --git a/data b/data -Subproject 638ae1e647bf8621da9f8ddd3d93cacb0788bb1 +Subproject 9597d175303c7ee8d836bac94a3393614b5ecf4 diff --git a/package-lock.json b/package-lock.json index d733816..f379fb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,8 @@ { - "requires": true, + "name": "brokentalents", + "version": "1.0.0", "lockfileVersion": 1, + "requires": true, "dependencies": { "abab": { "version": "1.0.4", @@ -75,6 +77,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "optional": true, "requires": { "micromatch": "^2.1.5", "normalize-path": "^2.0.0" @@ -163,7 +166,8 @@ "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "optional": true }, "asynckit": { "version": "0.4.0", @@ -872,6 +876,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, "requires": { "tweetnacl": "^0.14.3" } @@ -879,7 +884,8 @@ "binary-extensions": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=" + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "optional": true }, "bluebird": { "version": "3.5.1", @@ -934,6 +940,11 @@ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" }, + "bulma": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/bulma/-/bulma-0.7.1.tgz", + "integrity": "sha512-wRSO2LXB+qI9Pyz2id+uZr4quz5aftSN7Ay1ysr1+krzVp3utD+Ci4CeKuZdrYGc800t65b7heXBL6qw2Wo/lQ==" + }, "callsites": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", @@ -942,7 +953,8 @@ "camelcase": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "optional": true }, "cardinal": { "version": "1.0.0", @@ -962,6 +974,7 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "optional": true, "requires": { "align-text": "^0.1.3", "lazy-cache": "^1.0.3" @@ -983,6 +996,7 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "optional": true, "requires": { "anymatch": "^1.3.0", "async-each": "^1.0.0", @@ -1027,6 +1041,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "optional": true, "requires": { "center-align": "^0.1.1", "right-align": "^0.1.1", @@ -1036,7 +1051,8 @@ "wordwrap": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=" + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "optional": true } } }, @@ -1199,6 +1215,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, "requires": { "jsbn": "~0.1.0" } @@ -2448,6 +2465,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "optional": true, "requires": { "binary-extensions": "^1.0.0" } @@ -2954,7 +2972,8 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true }, "jsdom": { "version": "9.12.0", @@ -3042,7 +3061,8 @@ "lazy-cache": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=" + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "optional": true }, "lcid": { "version": "1.0.0", @@ -3612,7 +3632,8 @@ "process-nextick-args": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "optional": true }, "prr": { "version": "1.0.1", @@ -3694,6 +3715,7 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "optional": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -3708,6 +3730,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "optional": true, "requires": { "graceful-fs": "^4.1.2", "minimatch": "^3.0.2", @@ -3878,6 +3901,7 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "optional": true, "requires": { "align-text": "^0.1.1" } @@ -3958,7 +3982,8 @@ "set-immediate-shim": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "optional": true }, "shellwords": { "version": "0.1.1", @@ -4058,6 +4083,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "optional": true, "requires": { "safe-buffer": "~5.1.0" } @@ -4149,7 +4175,8 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true }, "type-check": { "version": "0.3.2", @@ -4163,6 +4190,7 @@ "version": "2.8.29", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "optional": true, "requires": { "source-map": "~0.5.1", "uglify-to-browserify": "~1.0.0", @@ -4173,6 +4201,7 @@ "version": "3.10.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "optional": true, "requires": { "camelcase": "^1.0.2", "cliui": "^2.1.0", @@ -4185,7 +4214,8 @@ "uglify-to-browserify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=" + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "optional": true }, "user-home": { "version": "1.1.1", @@ -4195,7 +4225,8 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "optional": true }, "uuid": { "version": "3.2.1", @@ -4319,7 +4350,8 @@ "window-size": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=" + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "optional": true }, "wordwrap": { "version": "0.0.3", |
