jenkins-bot has submitted this change and it was merged. Change subject: Remove tests/profiler.js ......................................................................
Remove tests/profiler.js * This exists as a separate package now at: https://github.com/gwicke/nodegrind Change-Id: I265a961ece39e4323a400eb795f114ca63d720d1 --- D tests/profiler.js 1 file changed, 0 insertions(+), 82 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/profiler.js b/tests/profiler.js deleted file mode 100644 index 63fd199..0000000 --- a/tests/profiler.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; -var profiler = require('v8-profiler'); - -/** - * Simplistic V8 CPU profiler wrapper, WIP - * - * Usage: - * npm install v8-profiler - * - * var profiler = require('./profiler'); - * profiler.start('parse'); - * <some computation> - * var prof = profiler.stop('parse'); - * fs.writeFileSync('parse.cpuprofile', JSON.stringify(prof)); - * - * Now you can load parse.cpuprofile into chrome, or (much nicer) convert it - * to calltree format using https://github.com/phleet/chrome2calltree: - * - * chrome2calltree -i parse.cpuprofile -o parse.calltree - * kcachegrind parse.calltree - * - * Then use kcachegrind to visualize the callgrind file. - */ - -/** -V8 prof node structure: -{ childrenCount: 3, - callUid: 3550382514, - selfSamplesCount: 0, - totalSamplesCount: 7706, - selfTime: 0, - totalTime: 7960.497092032271, - lineNumber: 0, - scriptName: '', - functionName: '(root)', - getChild: [Function: getChild] } - -sample cpuprofile (from Chrome): -{ - "functionName":"(root)", - "scriptId":"0", - "url":"", - "lineNumber":0, - "columnNumber":0, - "hitCount":0, - "callUID":4142747341, - "children":[{"functionName":"(program)","scriptId":"0","url":"","lineNumber":0,"columnNumber":0,"hitCount":3,"callUID":912934196,"children":[],"deoptReason":"","id":2},{"functionName":"(idle)","scriptId":"0","url":"","lineNumber":0,"columnNumber":0,"hitCount":27741,"callUID":176593847,"children":[],"deoptReason":"","id":3}],"deoptReason":"","id":1} -*/ - -function convertProfNode(node) { - var res = { - functionName: node.functionName, - lineNumber: node.lineNumber, - callUID: node.callUid, - hitCount: node.selfSamplesCount, - url: node.scriptName, - children: [], - }; - for (var i = 0; i < node.childrenCount; i++) { - res.children.push(convertProfNode(node.getChild(i))); - } - return res; -} - -function prof2cpuprofile(prof) { - return { - head: convertProfNode(prof.topRoot), - startTime: 0, - endTime: prof.topRoot.totalTime, - }; -} - -module.exports = { - // Start profiling - start: function(name) { - return profiler.startProfiling(name); - }, - // End profiling - stop: function(name) { - return prof2cpuprofile(profiler.stopProfiling(name)); - }, -}; -- To view, visit https://gerrit.wikimedia.org/r/260716 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I265a961ece39e4323a400eb795f114ca63d720d1 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra <[email protected]> Gerrit-Reviewer: Cscott <[email protected]> Gerrit-Reviewer: GWicke <[email protected]> Gerrit-Reviewer: Subramanya Sastry <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
