Skip to content

Commit 2b67f5b

Browse files
committed
fixup! report: include information about event loop itself
1 parent 307e230 commit 2b67f5b

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

doc/api/report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ is provided below for reference.
219219
{
220220
"type": "loop",
221221
"is_active": true,
222-
"address": "140696384399248"
222+
"address": "0x000055fc7b2cb180"
223223
}
224224
],
225225
"environmentVariables": {

src/node_report.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static void WriteNodeReport(Isolate* isolate,
319319
writer.json_keyvalue("is_active",
320320
static_cast<bool>(uv_loop_alive(env->event_loop())));
321321
writer.json_keyvalue("address",
322-
std::to_string(reinterpret_cast<int64_t>(env->event_loop())));
322+
ValueToHexString(reinterpret_cast<int64_t>(env->event_loop())));
323323
writer.json_end();
324324
}
325325

src/node_report.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,15 @@ void GetNodeReport(v8::Isolate* isolate,
5757
void ReportEndpoints(uv_handle_t* h, std::ostringstream& out);
5858
void WalkHandle(uv_handle_t* h, void* arg);
5959
std::string EscapeJsonChars(const std::string& str);
60+
6061
template <typename T>
61-
std::string ValueToHexString(T value);
62+
std::string ValueToHexString(T value) {
63+
std::stringstream hex;
64+
65+
hex << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex <<
66+
value;
67+
return hex.str();
68+
}
6269

6370
// Function declarations - export functions in src/node_report_module.cc
6471
void TriggerReport(const v8::FunctionCallbackInfo<v8::Value>& info);

src/node_report_utils.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,6 @@ void WalkHandle(uv_handle_t* h, void* arg) {
214214
writer->json_end();
215215
}
216216

217-
template <typename T>
218-
std::string ValueToHexString(T value) {
219-
std::stringstream hex;
220-
221-
hex << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex <<
222-
value;
223-
return hex.str();
224-
}
225-
226217
std::string EscapeJsonChars(const std::string& str) {
227218
const std::string control_symbols[0x20] = {
228219
"\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005",

0 commit comments

Comments
 (0)