From 5f8950b652bc6e384d266ee80b99b5ee091bdcfe Mon Sep 17 00:00:00 2001 From: Kelvin Jin Date: Mon, 10 Dec 2018 15:50:22 -0800 Subject: [PATCH] src: emit 'params' instead of 'data' for NodeTracing.dataCollected PR-URL: https://github.com/nodejs/node/pull/24949 Reviewed-By: Anna Henningsen Reviewed-By: Ali Ijaz Sheikh Reviewed-By: Colin Ihrig Reviewed-By: Anto Aravinth Reviewed-By: James M Snell --- src/inspector/tracing_agent.cc | 2 +- test/parallel/test-inspector-tracing-domain.js | 2 +- test/parallel/test-trace-events-dynamic-enable.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/inspector/tracing_agent.cc b/src/inspector/tracing_agent.cc index 64bf7457d9f728..e8f9d569f8ee69 100644 --- a/src/inspector/tracing_agent.cc +++ b/src/inspector/tracing_agent.cc @@ -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 << "}"; diff --git a/test/parallel/test-inspector-tracing-domain.js b/test/parallel/test-inspector-tracing-domain.js index ecf15c5be97630..9d3d33d94d5bbd 100644 --- a/test/parallel/test-inspector-tracing-domain.js +++ b/test/parallel/test-inspector-tracing-domain.js @@ -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'); diff --git a/test/parallel/test-trace-events-dynamic-enable.js b/test/parallel/test-trace-events-dynamic-enable.js index 645dcb2764a1be..b10152370f0116 100644 --- a/test/parallel/test-trace-events-dynamic-enable.js +++ b/test/parallel/test-trace-events-dynamic-enable.js @@ -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);