From 98d9540dd7a7aa2e612f16caeea6e57d56ed9f12 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Tue, 16 Jan 2018 17:13:36 -0800 Subject: src: use uv_hrtime as tracing timestamp Override the V8 TracingController to provide uv_hrtime based timestamps. This allows tracing timestamps to be comparable with process.hrtime timestamps. Fixes: https://github.com/nodejs/node/issues/17349 PR-URL: https://github.com/nodejs/node/pull/18196 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Andreas Madsen --- src/tracing/agent.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/tracing') diff --git a/src/tracing/agent.h b/src/tracing/agent.h index bd8e90004b..203f53be7e 100644 --- a/src/tracing/agent.h +++ b/src/tracing/agent.h @@ -8,7 +8,14 @@ namespace node { namespace tracing { -using v8::platform::tracing::TracingController; +class TracingController : public v8::platform::tracing::TracingController { + public: + TracingController() : v8::platform::tracing::TracingController() {} + + int64_t CurrentTimestampMicroseconds() override { + return uv_hrtime() / 1000; + } +}; class Agent { public: -- cgit v1.2.3