Skip to content

Commit 2cbb7a8

Browse files
jasnelladdaleax
authored andcommitted
perf_hooks: implement histogram based api
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: #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>
1 parent afb2d17 commit 2cbb7a8

18 files changed

+2207
-3
lines changed

LICENSE

+45
Original file line numberDiff line numberDiff line change
@@ -1371,3 +1371,48 @@ The externally maintained libraries used by Node.js are:
13711371
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
13721372
THE SOFTWARE.
13731373
"""
1374+
1375+
- HdrHistogram, located at deps/histogram, is licensed as follows:
1376+
"""
1377+
The code in this repository code was Written by Gil Tene, Michael Barker,
1378+
and Matt Warren, and released to the public domain, as explained at
1379+
http://creativecommons.org/publicdomain/zero/1.0/
1380+
1381+
For users of this code who wish to consume it under the "BSD" license
1382+
rather than under the public domain or CC0 contribution text mentioned
1383+
above, the code found under this directory is *also* provided under the
1384+
following license (commonly referred to as the BSD 2-Clause License). This
1385+
license does not detract from the above stated release of the code into
1386+
the public domain, and simply represents an additional license granted by
1387+
the Author.
1388+
1389+
-----------------------------------------------------------------------------
1390+
** Beginning of "BSD 2-Clause License" text. **
1391+
1392+
Copyright (c) 2012, 2013, 2014 Gil Tene
1393+
Copyright (c) 2014 Michael Barker
1394+
Copyright (c) 2014 Matt Warren
1395+
All rights reserved.
1396+
1397+
Redistribution and use in source and binary forms, with or without
1398+
modification, are permitted provided that the following conditions are met:
1399+
1400+
1. Redistributions of source code must retain the above copyright notice,
1401+
this list of conditions and the following disclaimer.
1402+
1403+
2. Redistributions in binary form must reproduce the above copyright notice,
1404+
this list of conditions and the following disclaimer in the documentation
1405+
and/or other materials provided with the distribution.
1406+
1407+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1408+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1409+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1410+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
1411+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
1412+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1413+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1414+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
1415+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1416+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
1417+
THE POSSIBILITY OF SUCH DAMAGE.
1418+
"""

deps/histogram/LICENSE.txt

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
The code in this repository code was Written by Gil Tene, Michael Barker,
2+
and Matt Warren, and released to the public domain, as explained at
3+
http://creativecommons.org/publicdomain/zero/1.0/
4+
5+
For users of this code who wish to consume it under the "BSD" license
6+
rather than under the public domain or CC0 contribution text mentioned
7+
above, the code found under this directory is *also* provided under the
8+
following license (commonly referred to as the BSD 2-Clause License). This
9+
license does not detract from the above stated release of the code into
10+
the public domain, and simply represents an additional license granted by
11+
the Author.
12+
13+
-----------------------------------------------------------------------------
14+
** Beginning of "BSD 2-Clause License" text. **
15+
16+
Copyright (c) 2012, 2013, 2014 Gil Tene
17+
Copyright (c) 2014 Michael Barker
18+
Copyright (c) 2014 Matt Warren
19+
All rights reserved.
20+
21+
Redistribution and use in source and binary forms, with or without
22+
modification, are permitted provided that the following conditions are met:
23+
24+
1. Redistributions of source code must retain the above copyright notice,
25+
this list of conditions and the following disclaimer.
26+
27+
2. Redistributions in binary form must reproduce the above copyright notice,
28+
this list of conditions and the following disclaimer in the documentation
29+
and/or other materials provided with the distribution.
30+
31+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
35+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
41+
THE POSSIBILITY OF SUCH DAMAGE.

deps/histogram/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# HdrHistogram_c
2+
3+
From: https://github.com/HdrHistogram/HdrHistogram_c

deps/histogram/histogram.gyp

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
'targets': [
3+
{
4+
'target_name': 'histogram',
5+
'type': 'static_library',
6+
'include_dirs': ['src'],
7+
'direct_dependent_settings': {
8+
'include_dirs': [ 'src' ]
9+
},
10+
'sources': [
11+
'src/hdr_histogram.c',
12+
]
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)