Skip to content

Instantly share code, notes, and snippets.

@fhinkel
Last active December 22, 2017 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fhinkel/549f975000056b22c7ca20311a490697 to your computer and use it in GitHub Desktop.
Save fhinkel/549f975000056b22c7ca20311a490697 to your computer and use it in GitHub Desktop.
{
"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"
}
}
// 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