src: emit 'params' instead of 'data' for NodeTracing.dataCollected
PR-URL: https://github.com/nodejs/node/pull/24949 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
1c52dccc54
commit
49f1db47e2
@ -31,7 +31,7 @@ class InspectorTraceWriter : public node::tracing::AsyncTraceWriter {
|
||||
return;
|
||||
json_writer_.reset();
|
||||
std::ostringstream result(
|
||||
"{\"method\":\"NodeTracing.dataCollected\",\"data\":",
|
||||
"{\"method\":\"NodeTracing.dataCollected\",\"params\":",
|
||||
std::ostringstream::ate);
|
||||
result << stream_.str();
|
||||
result << "}";
|
||||
|
@ -60,7 +60,7 @@ async function test() {
|
||||
await generateTrace();
|
||||
JSON.stringify(await post('NodeTracing.stop', { traceConfig }));
|
||||
session.disconnect();
|
||||
assert(traceNotification.data.value.length > 0);
|
||||
assert(traceNotification.params.value.length > 0);
|
||||
assert(tracingComplete);
|
||||
clearInterval(interval);
|
||||
console.log('Success');
|
||||
|
@ -28,8 +28,8 @@ async function test() {
|
||||
const events = [];
|
||||
let tracingComplete = false;
|
||||
session.on('NodeTracing.dataCollected', (n) => {
|
||||
assert.ok(n && n.data && n.data.value);
|
||||
events.push(...n.data.value); // append the events.
|
||||
assert.ok(n && n.params && n.params.value);
|
||||
events.push(...n.params.value); // append the events.
|
||||
});
|
||||
session.on('NodeTracing.tracingComplete', () => tracingComplete = true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user