summaryrefslogtreecommitdiff
path: root/src/node_perf.cc
Commit message (Collapse)AuthorAgeFilesLines
* perf_hooks: add idleTime and event loop utilTrevor Norris2020-08-291-0/+8
| | | | | | | | | | | | | | | | | | | | | Use uv_metrics_idle_time() to return a high resolution millisecond timer of the amount of time the event loop has been idle since it was initialized. Include performance.eventLoopUtilization() API to handle the math of calculating the idle and active times. This has been added to prevent accidental miscalculations of the event loop utilization. Such as not taking into consideration offsetting nodeTiming.loopStart or timing differences when being called from a Worker thread. PR-URL: https://github.com/nodejs/node/pull/34938 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Adrian Estrada <edsadr@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
* src: snapshot Environment upon instantiationJoyee Cheung2020-07-181-2/+48
| | | | | | | | | This includes the initial Environment (without running bootstrap scripts) into the builtin snapshot PR-URL: https://github.com/nodejs/node/pull/32984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
* src,doc,test: remove String::New default parameterAnna Henningsen2020-07-141-5/+2
| | | | | | | | | | | `kNormal` has been the implicit default for a while now (since V8 7.6). Refs: https://github.com/v8/v8/commit/e0d7f816990ada28ebe1281ca9431236ef8c6e4f PR-URL: https://github.com/nodejs/node/pull/34248 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: introduce BaseObject base FunctionTemplateAnna Henningsen2020-06-141-0/+1
| | | | | PR-URL: https://github.com/nodejs/node/pull/33772 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* src: remove unused using declarationsDaniel Bevenius2020-05-281-3/+0
| | | | | | | | | | | | This commit removes the unused using declarations reported by lint-cpp. PR-URL: https://github.com/nodejs/node/pull/33268 Refs: https://github.com/nodejs/node/issues/29226 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
* src: use enum for refed flag on native immediatesAnna Henningsen2020-05-211-2/+2
| | | | | | | | | | | Refs: https://github.com/nodejs/node/pull/33320#discussion_r423141443 PR-URL: https://github.com/nodejs/node/pull/33444 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
* perf_hooks: allow omitted parameters in 'performance.measure'himself652020-04-101-6/+11
| | | | | | | | | | | Make `startMark` and `endMark` parameters optional. PR-URL: https://github.com/nodejs/node/pull/32651 Fixes: https://github.com/nodejs/node/issues/32647 Refs: https://www.w3.org/TR/user-timing-2/#measure-method Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: align PerformanceState class name with conventionsAnna Henningsen2020-04-021-3/+3
| | | | | | | | | Class names are written in UpperCamelCase. Otherwise, this looks like it’s a variable, not a class name. PR-URL: https://github.com/nodejs/node/pull/32539 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: improve handling of internal field countingJames M Snell2020-03-021-1/+2
| | | | | | | | | | | | | | | | Change suggested by bnoordhuis. Improve handing of internal field counting by using enums. Helps protect against future possible breakage if field indexes are ever changed or added to. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/31960 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* perf_hooks: add property flags to GCPerformanceEntryKirill Fomichev2020-02-041-0/+20
| | | | | | PR-URL: https://github.com/nodejs/node/pull/29547 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
* src: make ELDHistogram a HandleWrapAnna Henningsen2019-09-071-26/+13
| | | | | | | | | This simplifies the implementation of ELDHistogram a bit, and more generally allows us to have weak JS references associated with `HandleWrap`s. PR-URL: https://github.com/nodejs/node/pull/29317 Reviewed-By: James M Snell <jasnell@gmail.com>
* perf_hooks: remove GC callbacks on zero observers countKirill Fomichev2019-09-071-8/+22
| | | | | | | | | When all existed PerformanceObserver instances removed for type `gc` GC callbacks should be removed. PR-URL: https://github.com/nodejs/node/pull/29444 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
* src: allow generic C++ callables in SetImmediate()Anna Henningsen2019-08-011-10/+10
| | | | | | | | | | | Modify the native `SetImmediate()` functions to take generic C++ callables as arguments. This makes passing arguments to the callback easier, and in particular, it allows passing `std::unique_ptr`s directly, which in turn makes sure that the data they point to is deleted if the `Environment` is torn down before the callback can run. PR-URL: https://github.com/nodejs/node/pull/28704 Reviewed-By: James M Snell <jasnell@gmail.com>
* perf_hooks: add HttpRequest statistics monitoring #28445vmarchaud2019-07-121-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ```js const { PerformanceObserver, performance } = require('perf_hooks'); const http = require('http'); const obs = new PerformanceObserver((items) => { const entry = items.getEntries()[0]; console.log(entry.name, entry.duration); }); obs.observe({ entryTypes: ['http'] }); const server = http.Server(function(req, res) { server.close(); res.writeHead(200); res.end('hello world\n'); }); server.listen(0, function() { const req = http.request({ port: this.address().port, path: '/', method: 'POST' }).end(); }); ``` PR-URL: https://github.com/nodejs/node/pull/28486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
* src: remove memory_tracker-inl.h from header filesSam Roberts2019-05-231-0/+1
| | | | | | | | | | | Inline headers should only be included into the .cc files that use them. PR-URL: https://github.com/nodejs/node/pull/27755 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: remove util-inl.h from header filesSam Roberts2019-05-131-0/+1
| | | | | | | | | | | | Its intended that *-inl.h header files are only included into the src files that call the inline methods. Explicitly include it into the files that need it. PR-URL: https://github.com/nodejs/node/pull/27631 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* src: use predefined AliasedBuffer types in the code baseJoyee Cheung2019-04-261-8/+4
| | | | | | | | | | Instead of allowing the callers to instantiate the template with any numeric types (such as aliasing a Uint8Array to double[]), predefine types that make sense and use those instead. PR-URL: https://github.com/nodejs/node/pull/27334 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: replace FromJust() with Check() when possibleSam Roberts2019-04-121-10/+10
| | | | | | | | | | | | | | | | | | FromJust() is often used not for its return value, but for its side-effects. In these cases, Check() exists, and is more clear as to the intent. From its comment: To be used, where the actual value of the Maybe is not needed, like Object::Set. See: https://github.com/nodejs/node/pull/26929/files#r269256335 PR-URL: https://github.com/nodejs/node/pull/27162 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
* src: port coverage serialization to C++Joyee Cheung2019-04-061-23/+0
| | | | | | | | | | | This patch moves the serialization of coverage profiles into C++. With this we no longer need to patch `process.reallyExit` and hook into the exit events, but instead hook into relevant places in C++ which are safe from user manipulation. This also makes the code easier to reuse for other types of profiles. PR-URL: https://github.com/nodejs/node/pull/26874 Reviewed-By: Ben Coe <bencoe@gmail.com>
* perf_hooks: reset prev_ before starting ELD timerGerhard Stoebich2019-03-201-0/+1
| | | | | | | | | | | reset `ELDHistogram.prev_` before staring timer to ensure that start timer doesn't leak across `disable()` `enable()` calls. PR-URL: https://github.com/nodejs/node/pull/26693 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
* src: prefer to get `Environment` from `Context`Anna Henningsen2019-03-051-3/+2
| | | | | | | | | | | We explicitly store the context anyway, and can skip the extra steps introduced in `Environment::GetCurrent()`. PR-URL: https://github.com/nodejs/node/pull/26376 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: apply clang-tidy rule performance-unnecessary-value-paramgengjiawen2019-02-191-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/26042 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: unify uptime base used across the code baseJoyee Cheung2019-02-181-1/+0
| | | | | | | | | | This patch joins `per_process::prog_start_time` (a double) and `performance::performance_node_start` (a uint64_t) into a `per_process::node_start_time` (a uint64_t) which gets initialized in `node::Start()`. PR-URL: https://github.com/nodejs/node/pull/26016 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* perf_hooks: implement histogram based apiJames M Snell2019-02-081-0/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a sampling-based event loop delay monitor. ```js const { monitorEventLoopDelay } = require('perf_hooks'); const h = monitorEventLoopDelay(); h.enable(); h.disable(); console.log(h.percentiles); console.log(h.min); console.log(h.max); console.log(h.mean); console.log(h.stddev); console.log(h.percentile(50)); ``` PR-URL: https://github.com/nodejs/node/pull/25378 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* perf_hooks: only enable GC tracking when it's requestedJoyee Cheung2019-02-061-3/+5
| | | | | | | | | | | | | | | Previously a GC prologue callback and a GC epilogue callback are always unconditionally enabled during bootstrap when the `performance` binding is loaded, even when the user does not use the performance timeline API to enable GC tracking. This patch makes the callback addition conditional and only enables them when the user explicitly requests `observer.observe(['gc'])` to avoid the overhead. PR-URL: https://github.com/nodejs/node/pull/25853 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: simplify SlicedArgumentsAnna Henningsen2019-01-311-2/+2
| | | | | | | | Re-use the existing `MaybeStackBuffer` logic for `SlicedArguments`. PR-URL: https://github.com/nodejs/node/pull/25745 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* src: pass along errors from perf obj instantiationAnna Henningsen2019-01-291-11/+18
| | | | | | PR-URL: https://github.com/nodejs/node/pull/25734 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
* perf_hooks: clean up GC listenersAnna Henningsen2019-01-281-0/+5
| | | | | | | | | | Add Environment cleanup hooks to remove GC listeners when the `Environment` is torn down. PR-URL: https://github.com/nodejs/node/pull/25647 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* perf_hooks: make GC tracking state per-EnvironmentAnna Henningsen2018-12-171-9/+9
| | | | | | | | | | | Otherwise this is global state that may be subject to race conditions e.g. when running `perf_hooks` inside of Worker threads. Tracking the GC type is removed entirely since the variable was unused. PR-URL: https://github.com/nodejs/node/pull/25053 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: fix type mismatch warnings from missing privSam Roberts2018-12-031-1/+2
| | | | | | | | | Registration initialization functions are expected to have a 4th argument, a void*, so add them where necessary to fix the warnings. PR-URL: https://github.com/nodejs/node/pull/24737 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* src: elevate v8 namespaces of referenced artifactsKanika Singhal2018-11-171-18/+25
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/24424 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
* test: verify `performance.timerify()` works w/ non-Node ContextsAnna Henningsen2018-10-251-1/+1
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/23784 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: simplify `TimerFunctionCall()` in `node_perf.cc`Anna Henningsen2018-10-241-39/+20
| | | | | | | | | | | | | | Picking a path according to a boolean is essentially free, compared to the cost of a function call. Also, remove an unnecessary `TryCatch`. PR-URL: https://github.com/nodejs/node/pull/23782 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: replace deprecated uses of FunctionTemplate::GetFunctionAndreas Haas2018-09-241-1/+1
| | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/22993 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: refactor `Environment::GetCurrent()` usageAnna Henningsen2018-09-171-0/+1
| | | | | | | | | | | | | | | | | Make `Environment::GetCurrent()` return `nullptr` if the current `Context` is not a Node.js context, and for the relevant usage of this function, either: - Switch to the better `GetCurrent(args)` variant - Turn functions in to no-ops where it makes sense - Make it a `CHECK`, i.e. an API requirement, where it make sense - Leave a `TODO` comment for verifying what, if anything, is to be done PR-URL: https://github.com/nodejs/node/pull/22819 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
* perf_hooks: move strings to envJames M Snell2018-08-211-4/+4
| | | | | | | | | | | | Move repeatedly created strings to env PR-URL: https://github.com/nodejs/node/pull/22401 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* perf_hooks: avoid memory leak on gc observerJames M Snell2018-08-131-0/+3
| | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/22229 PR-URL: https://github.com/nodejs/node/pull/22241 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: George Adams <george.adams@uk.ibm.com>
* src: move process.binding('performance') to internalBindingJames M Snell2018-08-091-1/+1
| | | | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/22029 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: remove calls to deprecated v8 functions (NewFromUtf8)Ujjwal Sharma2018-07-291-4/+8
| | | | | | | | | | | Remove all calls to deprecated v8 functions (here: String::NewFromUtf8) inside the code (src directory only). PR-URL: https://github.com/nodejs/node/pull/21926 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: avoid common case heap allocationBen Noordhuis2018-06-221-6/+1
| | | | | | | | | | | | | Optimize three functions that pass on (part of) their JS arguments to the JS function they call by stack-allocating the storage in the common case. PR-URL: https://github.com/nodejs/node/pull/21409 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
* perf_hooks: simplify perf_hooksJames M Snell2018-04-031-1/+13
| | | | | | | | | | | | Remove the `performance.getEntries()` and `performance.clear*()` variants and eliminate the accumulation of the global timeline entries. The design of this particular bit of the API is a memory leak and performance footgun. The `PerformanceObserver` API is a better approach to consuming the data in a more transient way. PR-URL: https://github.com/nodejs/node/pull/19563 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: name all builtin init functions InitializeDaniel Bevenius2018-03-261-4/+4
| | | | | | | | | | This commit renames a few of the builtin modules init functions to Initialize for consistency. PR-URL: https://github.com/nodejs/node/pull/19550 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* perf_hooks,trace_events: fix timescale on bootstrap marksJames M Snell2018-03-191-1/+1
| | | | | PR-URL: https://github.com/nodejs/node/pull/19450 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* perf_hooks,trace_events: emit perf milestone trace eventsJames M Snell2018-03-161-5/+11
| | | | | | | Emit the perf_hooks node timing milestones as trace events. PR-URL: https://github.com/nodejs/node/pull/19175 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* src: add tracing category macrosJames M Snell2018-03-091-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Adds `TRACING_CATEGORY_NODE`, `TRACING_CATEGORY_NODE1` and `TRACING_CATEGORY_NODE2` helper macros for consistently building trace event category strings. For instance, `TRACING_CATEGORY_NODE2(foo, bar)` would generate the category string `node,node.foo,node.foo.bar`, such that... ``` TRACE_EVENT_NESTABLE_ASYNC_BEGIN0( TRACING_CATEGORY_NODE2(foo, bar), "baz", 1); ``` Would emit if trace events are enabled for categories: `node`, `node.foo`, or `node.foo.bar`. This allows a natural scoping down of what trace events a user may want to receive. Enabling the `node` category would receive everything Node.js produces. PR-URL: https://github.com/nodejs/node/pull/19155 Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
* perf_hooks: fix timingTimothy Gu2018-03-061-0/+35
| | | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/17892 Fixes: https://github.com/nodejs/node/issues/17893 Fixes: https://github.com/nodejs/node/issues/18992 PR-URL: https://github.com/nodejs/node/pull/18993 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
* perf_hooks: emit trace events for marks, measures, and timerifyJames M Snell2018-02-261-4/+16
| | | | | | | | | | | | | | Adds the `node.perf.usertiming` trace events category for recording usertiming marks and measures (e.g. `perf_hooks.performance.mark()`) in the trace events timeline. Adds the `node.perf.function` trace events category for recording `perf_hooks.performance.timerify()` durations in the trace events timeline. PR-URL: https://github.com/nodejs/node/pull/18789 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* perf_hooks: eliminate deprecation warningJames M Snell2018-02-261-1/+1
| | | | | | PR-URL: https://github.com/nodejs/node/pull/18789 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: fix deprecation warning in node_perf.ccDaniel Bevenius2018-02-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | Currently the following deprecation warning is produced when compiling node_perf.cc: ./src/node_perf.cc:91:11: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations] node::MakeCallback(env->isolate(), ^ ../src/node.h:172:50: note: 'MakeCallback' has been explicitly marked deprecated here NODE_EXTERN v8::Local<v8::Value> MakeCallback( ^ 1 warning generated. This commit adds an async_context to the call and checks the maybe result. PR-URL: https://github.com/nodejs/node/pull/18877 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
* src: remove unused variablecjihrig2018-01-271-2/+0
| | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/18385 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>