Skip to content

Commit

Permalink
also print duration in the callaback execution
Browse files Browse the repository at this point in the history
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
  • Loading branch information
shirady committed Dec 22, 2024
1 parent d524460 commit 8b1a50d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sdk/namespace_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,10 @@ class NamespaceFS {
// TODO buffers_pool and the underlying semaphore should support abort signal
// to avoid sleeping inside the semaphore until the timeout while the request is already aborted.
const { buffer, callback } = await multi_buffer_pool.get_buffers_pool(remain_size).get_buffer();
const start_time = performance.now();
buffer_pool_cleanup = callback; // must be called ***IMMEDIATELY*** after get_buffer
const end_time = performance.now();
dbg.log2(`get_buffer: Time taken to execute callback is ${end_time - start_time} ms.`);
object_sdk.throw_if_aborted();

// read from file
Expand Down

0 comments on commit 8b1a50d

Please sign in to comment.