Last active
December 22, 2017 12:23
-
-
Save fhinkel/549f975000056b22c7ca20311a490697 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "profiler-issue", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"@google-cloud/profiler": "^0.1.8" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// const profiler = require('@google-cloud/profiler') | |
let count = 0; | |
function additionFunction() { | |
let a = 0 | |
for (var i = 0; i < 10000; i++) { | |
a = a + 3; | |
a = a * a; | |
a = Math.sqrt(a); | |
} | |
setImmediate(additionFunction); | |
} | |
function fillBuffer() { | |
var buffer = new Buffer(500); | |
for (var k = 0; k < 1e2; k++) | |
buffer.fill(0); | |
setImmediate(fillBuffer); | |
} | |
// profiler.start({ | |
// projectId: 'nolanmar-testappstandard', | |
// logLevel: 5, | |
// serviceContext: { | |
// service: 'app-std', | |
// version: '0' | |
// }, | |
// }); | |
additionFunction(); | |
fillBuffer(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment