smartlog-destination-devtools/.cache/2a/d84283acedd63d7fe07bcab7247d2c.json

1 line
38 KiB
JSON
Raw Normal View History

2018-11-13 00:32:39 +00:00
{"id":"node_modules/leakage/lib/result.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/package.json","includedInParent":true,"mtime":1542067438335},{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/leakage/package.json","includedInParent":true,"mtime":1542058764034},{"name":"pretty-bytes","loc":{"line":1,"column":28},"parent":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/leakage/lib/result.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/node_modules/pretty-bytes/index.js"}],"generated":{"js":"function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nvar prettyBytes = require('pretty-bytes');\n\nmodule.exports = {\n createResult: createResult\n};\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(heapDiffs, gcollections, iterations) {\n _classCallCheck(this, Result);\n\n this.heapDiffs = heapDiffs;\n this.gcollections = gcollections;\n this.iterations = iterations;\n }\n\n _createClass(Result, [{\n key: \"printSummary\",\n value: function printSummary(title) {\n var log = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : console.log;\n var changesInBytes = this.heapDiffs.map(function (heapDiff) {\n return heapDiff.change.size_bytes;\n });\n var average = changesInBytes.reduce(function (sum, change) {\n return sum + change;\n }, 0) / changesInBytes.length;\n var minimum = changesInBytes.reduce(function (min, change) {\n return change < min ? change : min;\n }, Infinity);\n var maximum = changesInBytes.reduce(function (max, change) {\n return change > max ? change : max;\n }, -Infinity);\n log(title ? \"Leak test summary - \".concat(title, \":\") : \"Leak test summary:\");\n log(\" Did \".concat(this.gcollections, \" heap diffs, iterating \").concat(this.iterations, \" times each.\"));\n log(\" Heap diff summary: \".concat(formatDiffSize(average), \" avg, \").concat(formatDiffSize(minimum), \" min, \").concat(formatDiffSize(maximum), \" max\"));\n log(\" Heap diffs: \".concat(this.heapDiffs.map(function (heapDiff) {\n return formatDiffSize(heapDiff.change.size_bytes);\n })));\n }\n }]);\n\n return Result;\n}();\n\nfunction createResult(heapDiffs, options) {\n var {\n gcollections: gcollections,\n iterations: iterations\n } = options;\n return new Result(heapDiffs, gcollections, iterations);\n}\n\nfunction formatDiffSize(size) {\n var formattedSize = prettyBytes(size);\n return size > 0 ? \"+\".concat(formattedSize) : formattedSize;\n}","map":{"mappings":[{"generated":{"line":7,"column":0},"source":"node_modules/leakage/lib/result.js","original":{"line":1,"column":0}},{"name":"prettyBytes","generated":{"line":7,"column":4},"source":"node_modules/leakage/lib/result.js","original":{"line":1,"column":6}},{"generated":{"line":7,"column":15},"source":"node_modules/leakage/lib/result.js","original":{"line":1,"column":17}},{"name":"require","generated":{"line":7,"column":18},"source":"node_modules/leakage/lib/result.js","original":{"line":1,"column":20}},{"generated":{"line":7,"column":25},"source":"node_modules/leakage/lib/result.js","original":{"line":1,"column":27}},{"generated":{"line":7,"column":26},"source":"node_modules/leakage/lib/result.js","original":{