0

I'm using google cloud profiler in my Node.JS application and I would like to understand the wall time.
Is wall time profiler in Google Cloud Profiler also include the time I wait for async logic such as waiting for an API response?

For example, If have the following code:

async function someFunction(){
  logic(); //take around 1 ms
  await asyncLogic(); //take around 5 ms (
}

The data I'll see in GCP for someFunction will be around 1ms because that the time CPU was actually in use, or will it be 6 ms because wall time include the time we wait for I/O?

Google Definition

In google docs wall time profile defined as:

Wall-clock time (also called wall time) is the time it takes to run a block of code.

The wall-clock time for a function measures the time elapsed between entering and exiting a function. Wall-clock time includes all wait time, including that for locks and thread synchronization. The wall time for a block of code can never be less than the CPU time.

But I'm not sure how it actually work with node.js eventloop.

shay
  • 7
  • 4

0 Answers0