From 76e3d45c34d49a682de871e500ed45f8a61a43c7 Mon Sep 17 00:00:00 2001 From: Charles Dick Date: Wed, 1 Feb 2017 10:44:23 -0800 Subject: [PATCH] Add cell size to JSC heap capture visualization Reviewed By: bnham Differential Revision: D4469000 fbshipit-source-id: 3e572bb7bdd83f79009d2059d543e03e6a57bba0 --- local-cli/server/middleware/heapCapture/src/heapCapture.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/local-cli/server/middleware/heapCapture/src/heapCapture.js b/local-cli/server/middleware/heapCapture/src/heapCapture.js index 5a8633880..a40888988 100644 --- a/local-cli/server/middleware/heapCapture/src/heapCapture.js +++ b/local-cli/server/middleware/heapCapture/src/heapCapture.js @@ -342,6 +342,7 @@ function registerCapture(data, captureId, capture, stacks, strings) { parseInt(id, 16), ref.type, ref.size, + ref.cellSize, captureId, ref.rootPath === undefined ? noneStack : ref.rootPath, ref.reactTree === undefined ? noneStack : ref.reactTree, @@ -355,6 +356,7 @@ function registerCapture(data, captureId, capture, stacks, strings) { parseInt(id, 16), 'Marked Block Overhead', block.capacity - block.size, + 0, captureId, noneStack, noneStack, @@ -372,6 +374,7 @@ if (preLoadedCapture) { { name: 'id', type: 'int' }, { name: 'type', type: 'string', strings: strings }, { name: 'size', type: 'int' }, + { name: 'cell', type: 'int' }, { name: 'trace', type: 'string', strings: strings }, { name: 'path', type: 'stack', stacks: stacks, getter: x => strings.get(x), formatter: x => x }, { name: 'react', type: 'stack', stacks: stacks, getter: x => strings.get(x), formatter: x => x }, @@ -398,8 +401,10 @@ if (preLoadedCapture) { valueExpander, ]); const sizeAggregator = aggrow.addSumAggregator('Size', 'size'); + const cellAggregator = aggrow.addSumAggregator('Cell Size', 'cell'); const countAggregator = aggrow.addCountAggregator('Count'); aggrow.expander.setActiveAggregators([ + cellAggregator, sizeAggregator, countAggregator, ]);