From 2f39027d4e3fe5839262d2c599d9a4398d0cecda 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 fe69e6f863e2a6..2f815eb2fbbc7f 100644 --- a/src/inspector/tracing_agent.cc +++ b/src/inspector/tracing_agent.cc @@ -30,7 +30,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 e86996eb5c5892..12e9ef8fcd8521 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);