src: add COUNT_GENERIC_USAGE utility for tests

PR-URL: https://github.com/nodejs/node/pull/60434
Fixes: https://github.com/nodejs/node/issues/60423
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
This commit is contained in:
Joyee Cheung authored and Antoine du Hamel committed 2026-02-19 18:46:22 +01:00
1 parent d24ba4fed6
commit ece4acc18f
3 files changed
+35 -2

No files matched your search

+4
View File
@@ -13,10 +13,14 @@ namespace debug {
void TrackV8FastApiCall(FastStringKey key);
int GetV8FastApiCallCount(FastStringKey key);
void CountGenericUsage(const char* counter_name);
#define COUNT_GENERIC_USAGE(name) node::debug::CountGenericUsage(name)
#define TRACK_V8_FAST_API_CALL(key) \
node::debug::TrackV8FastApiCall(FastStringKey(key))
#else // !DEBUG
#define TRACK_V8_FAST_API_CALL(key)
#define COUNT_GENERIC_USAGE(name)
#endif // DEBUG
} // namespace debug