diff options
author | Yuriy Vasiyarov <yvasiyarov@ozon.travel> | 2019-05-30 16:41:03 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-07-30 11:36:51 -0700 |
commit | 21a7c695f0601ae10ccf6f6cdc9f35f56be2fe90 (patch) | |
tree | c6eb8e8c1d9905727e08b0f429e821c99b94b6ca /test | |
parent | 8be37663532ac364ef57eb33913ae4ece583077d (diff) | |
download | android-node-v8-21a7c695f0601ae10ccf6f6cdc9f35f56be2fe90.tar.gz android-node-v8-21a7c695f0601ae10ccf6f6cdc9f35f56be2fe90.tar.bz2 android-node-v8-21a7c695f0601ae10ccf6f6cdc9f35f56be2fe90.zip |
src: export v8.GetHeapCodeAndMetadataStatistics()
Export statistic provided by V8 through HeapCodeStatistics class and
and GetHeapCodeAndMetadataStatistics function to v8 Node.js module
PR-URL: https://github.com/nodejs/node/pull/27978
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-v8-stats.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/parallel/test-v8-stats.js b/test/parallel/test-v8-stats.js index 3e2eadef17..d79ab84956 100644 --- a/test/parallel/test-v8-stats.js +++ b/test/parallel/test-v8-stats.js @@ -22,6 +22,18 @@ keys.forEach(function(key) { }); +const heapCodeStatistics = v8.getHeapCodeStatistics(); +const heapCodeStatisticsKeys = [ + 'bytecode_and_metadata_size', + 'code_and_metadata_size', + 'external_script_source_size']; +assert.deepStrictEqual(Object.keys(heapCodeStatistics).sort(), + heapCodeStatisticsKeys); +heapCodeStatisticsKeys.forEach(function(key) { + assert.strictEqual(typeof heapCodeStatistics[key], 'number'); +}); + + const expectedHeapSpaces = [ 'code_large_object_space', 'code_space', |