Skip to content

Commit 2e55992

Browse files
committed
src: track fast api call
1 parent 74590ae commit 2e55992

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/udp_wrap.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "env-inl.h"
2424
#include "handle_wrap.h"
2525
#include "node_buffer.h"
26+
#include "node_debug.h"
2627
#include "node_errors.h"
2728
#include "node_external_reference.h"
2829
#include "node_sockaddr-inl.h"
@@ -690,13 +691,15 @@ ReqWrap<uv_udp_send_t>* UDPWrap::CreateSendWrap(size_t msg_size) {
690691
}
691692

692693
double UDPWrap::FastGetSendQueueSize(Local<Value> receiver) {
694+
TRACK_V8_FAST_API_CALL("udp.getSendQueueSize");
693695
UDPWrap* wrap = BaseObject::Unwrap<UDPWrap>(receiver.As<Object>());
694696
if (wrap == nullptr) return static_cast<double>(UV_EBADF);
695697
return static_cast<double>(
696698
uv_udp_get_send_queue_size(wrap->GetLibuvHandle()));
697699
}
698700

699701
double UDPWrap::FastGetSendQueueCount(Local<Value> receiver) {
702+
TRACK_V8_FAST_API_CALL("udp.getSendQueueCount");
700703
UDPWrap* wrap = BaseObject::Unwrap<UDPWrap>(receiver.As<Object>());
701704
if (wrap == nullptr) return static_cast<double>(UV_EBADF);
702705
return static_cast<double>(

test/parallel/test-dgram-fast.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ testFastDgram();
3232

3333
if (common.isDebug) {
3434
const { getV8FastApiCallCount } = internalBinding('debug');
35-
assert.strictEqual(getV8FastApiCallCount('udp.getSendQueueSize'), 1);
36-
assert.strictEqual(getV8FastApiCallCount('udp.getSendQueueCount'), 1);
35+
assert.strictEqual(getV8FastApiCallCount('udp.getSendQueueSize'), 0);
36+
assert.strictEqual(getV8FastApiCallCount('udp.getSendQueueCount'), 0);
3737
}

0 commit comments

Comments
 (0)