Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracing use cases and interface #31

Closed
lucamaraschi opened this issue Oct 9, 2015 · 5 comments
Closed

Tracing use cases and interface #31

lucamaraschi opened this issue Oct 9, 2015 · 5 comments

Comments

@lucamaraschi
Copy link

We discussed during the last WG about the usage interface for the V8 tracing API (on-demand vs. continuous streaming) but we should define some concrete use cases and define as our goal to achieve a usable interface for consuming and/or retrieving all the tracing informations.

@bnoordhuis
Copy link
Member

I think a good first step would be to make sure that the tracing infrastructure can do what the dtrace/etw/lttng/systemtap USDT probes do now. There are only a handful of them so that shouldn't be a huge undertaking. For posterity:

lib/_http_client.js:163:  DTRACE_HTTP_CLIENT_REQUEST(this, this.connection);
lib/_http_client.js:410:  DTRACE_HTTP_CLIENT_RESPONSE(socket, req);
lib/_http_server.js:100:  DTRACE_HTTP_SERVER_RESPONSE(this.connection);
lib/_http_server.js:473:    DTRACE_HTTP_SERVER_REQUEST(req, socket);
lib/net.js:402:  DTRACE_NET_STREAM_END(this);
lib/net.js:1424:  DTRACE_NET_SERVER_CONNECTION(socket);

(The DTRACE_ prefix is for historical reasons, we should rename them.)

Once that works, we can think about adding trace points to e.g. the ArrayBuffer allocator, the various Wrap constructors/destructors, and so on.

Sounds reasonable? Who's volunteering?

@trevnorris
Copy link

I'm fine to implement that, but what would the API be? The hooks I'm thinking of would live in the native code, not in JS.

Additionally I think it's a poor JS API decision to simply call the function and say "it's a noop". Because in reality it isn't. These should be conditionally wrapped, regardless of how ugly it looks. Especially if they're going to be injected into more and more locations in the future.

@bripkens
Copy link

bripkens commented Jan 3, 2016

@lucamaraschi: […] we should define some concrete use cases […]

From nodejs/node#4496:

As a developer, I want to see when garbage collections happen and
how long they take in the production environment so that I can get a
feeling for GC pressure and the behavior of my application.

@trevnorris: The hooks I'm thinking of would live in the native code, not in JS.

Assuming that you define hooks as "an API to access trace data": It would be neat to see a JS API for that. Main reason as outlined in nodejs/node#4496:

Users of such monitoring tools, or more generally users interested in GC activity, need to compile native addons in order to access this information. It is hard to explain why users need to do this (or have a package such as build-essential installed). This gets increasingly harder in Java shops which are used to having everything in the platform. Building these addons automatically on install only reduces this problem, but doesn't remove it.

Being able to retrieve this information from JS directly would mean that monitoring tools could ship with fewer addons.

@trevnorris
Copy link

I didn't mean there wouldn't be a JS API, only that the hooks/counters would exist in the native side.

@joshgav
Copy link
Contributor

joshgav commented Sep 21, 2016

closing old AsyncWrap issues, please start a new thread if appropriate

The API and format discussion is continuing in #53

@joshgav joshgav closed this as completed Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants