Skip to content

Incorrect source file names in time profiles in Node 8 #89

@nolanmar511

Description

@nolanmar511

For the sample application, a time profile indicated that the function 'fill' was located within the source file below, when it should be marked as within 'buffer.js'. This is likely a problem with serialization, and since much of the serialization code is shared, heap profiles may also be impacted.

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();

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: cloudprofilerIssues related to the googleapis/cloud-profiler-nodejs API.triage meI really want to be triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions