{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/4496","labels_url":"https://api.github.com/repos/nodejs/node/issues/4496/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/4496/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/4496/events","html_url":"https://github.com/nodejs/node/issues/4496","id":124441663,"number":4496,"title":"Add GC Insights","user":{"login":"bripkens","id":596443,"avatar_url":"https://avatars.githubusercontent.com/u/596443?v=3","gravatar_id":"","url":"https://api.github.com/users/bripkens","html_url":"https://github.com/bripkens","followers_url":"https://api.github.com/users/bripkens/followers","following_url":"https://api.github.com/users/bripkens/following{/other_user}","gists_url":"https://api.github.com/users/bripkens/gists{/gist_id}","starred_url":"https://api.github.com/users/bripkens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bripkens/subscriptions","organizations_url":"https://api.github.com/users/bripkens/orgs","repos_url":"https://api.github.com/users/bripkens/repos","events_url":"https://api.github.com/users/bripkens/events{/privacy}","received_events_url":"https://api.github.com/users/bripkens/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/feature%20request","name":"feature request","color":"0D7BDE"},{"url":"https://api.github.com/repos/nodejs/node/labels/v8","name":"v8","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-31T07:24:26Z","updated_at":"2016-01-03T09:11:01Z","closed_at":null,"body":"As more and more enterprise customers are using Node.js, the demand for Node.js monitoring increased as well. Node.js already supports a bunch of ways for retrieving interesting information, but GC information is lacking. Many platforms, e.g. the JVM, support means to programmatically retrieve information about GCs. It would be useful if Node.js had these features too.\r\n\r\nThe main users for GC insights will probably be monitoring products. The way these products currently access GC information is via native addons that make use of `AddGCEpilogueCallback`. An example open source implementation of this is [node-gcstats](https://www.npmjs.com/package/gc-stats). Strongloop, Ruxit, Instana and others have their own, probably similar implementations.\r\n\r\nUsers 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.\r\n\r\nNode.js used to contain post-gc event infrastructure, but it was removed at the end of last year (Dec 2014) by @bnoordhuis with [the following commit](https://github.com/nodejs/node/commit/dab6f681cd8c43351aa56f4deb2e327c8e4c5cfe):\r\n\r\n> lib,src: remove post-gc event infrastructure\r\n> Remove the 'gc' event from the v8 module and remove the supporting\r\n> infrastructure from src/.  It gets the axe because:\r\n> \r\n> 1. There are currently no users.  It was originally conceived as\r\n>    an upstreamed subset of StrongLoop's strong-agent GC metrics,\r\n>    but the strong-agent code base has evolved considerably since\r\n>    that time and has no use anymore for what is in core.\r\n> \r\n> 2. The implementation is not quite sound.  It calls into JS land\r\n>    from inside the GC epilog and that is unsafe.  We could fix\r\n>    that by delaying the callback until a safe time but because\r\n>    there are no users anyway, removing it is all around easier.\r\n> \r\n> PR-URL: #174\r\n> Reviewed-By: Trevor Norris <trev.norris@gmail.com>\r\n\r\nI believe that we got users of such functionality (mainly through monitoring products) and that we could fix the implementation (the second argument in the commit comment). For these reasons, I propose to add the removed functionality back to the `v8` module and improve on it, e.g. by [scheduling work](https://github.com/dainis/node-gcstats/blob/74158ed43841ce92c83feaecaa491df7e7532340/src/gcstats.cc#L125) via `uv_queue_work`. I am willing to do this work and open a PR.\r\n\r\n*Disclaimer: I am working for [Instana](http://www.instana.com/) and we have a Node.js sensor with GC information.*"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/168479968","html_url":"https://github.com/nodejs/node/issues/4496#issuecomment-168479968","issue_url":"https://api.github.com/repos/nodejs/node/issues/4496","id":168479968,"user":{"login":"bripkens","id":596443,"avatar_url":"https://avatars.githubusercontent.com/u/596443?v=3","gravatar_id":"","url":"https://api.github.com/users/bripkens","html_url":"https://github.com/bripkens","followers_url":"https://api.github.com/users/bripkens/followers","following_url":"https://api.github.com/users/bripkens/following{/other_user}","gists_url":"https://api.github.com/users/bripkens/gists{/gist_id}","starred_url":"https://api.github.com/users/bripkens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bripkens/subscriptions","organizations_url":"https://api.github.com/users/bripkens/orgs","repos_url":"https://api.github.com/users/bripkens/repos","events_url":"https://api.github.com/users/bripkens/events{/privacy}","received_events_url":"https://api.github.com/users/bripkens/received_events","type":"User","site_admin":false},"created_at":"2016-01-03T09:11:01Z","updated_at":"2016-01-03T09:11:01Z","body":"> One thing to note is that this use-case has some overlap with tracing and trace-event\r\n\r\nThat is some very big overlap. I like where the trace-event discussions are going. If trace-event works out and is controllable via Node.js, my proposal would be completely obsolete. Still got some questions in my head and will post them to the WG.\r\n\r\nI'll update this issue once these questions are resolved. Thank you @ofrobots."}}