diff --git a/ts/src/profile-serializer.ts b/ts/src/profile-serializer.ts index 8392c493..d3378c29 100644 --- a/ts/src/profile-serializer.ts +++ b/ts/src/profile-serializer.ts @@ -259,28 +259,6 @@ function createCpuValueType(table: StringTable): ValueType { }); } -/** - * @return value type for object counts (type:objects, units:count), and - * adds strings used in this value type to the table. - */ -function createObjectCountValueType(table: StringTable): ValueType { - return new ValueType({ - type: table.dedup('objects'), - unit: table.dedup('count'), - }); -} - -/** - * @return value type for memory allocations (type:space, units:bytes), and - * adds strings used in this value type to the table. - */ -function createAllocationValueType(table: StringTable): ValueType { - return new ValueType({ - type: table.dedup('space'), - unit: table.dedup('bytes'), - }); -} - function createInUseObjectCountValueType(table: StringTable): ValueType { return new ValueType({ type: table.dedup('inuse_objects'), @@ -646,8 +624,8 @@ export function serializeHeapProfile( createAllocatedSpaceValueType(stringTable), ] : [ - createObjectCountValueType(stringTable), - createAllocationValueType(stringTable), + createInUseObjectCountValueType(stringTable), + createInUseSpaceValueType(stringTable), ]; const profile = { diff --git a/ts/test/profiles-for-tests.ts b/ts/test/profiles-for-tests.ts index 3e1ea7c1..fd29a9c7 100644 --- a/ts/test/profiles-for-tests.ts +++ b/ts/test/profiles-for-tests.ts @@ -331,9 +331,9 @@ export const heapProfile = new Profile({ location: heapLocations, function: heapFunctions, stringTable: buildStringTable([ - 'objects', + 'inuse_objects', 'count', - 'space', + 'inuse_space', 'bytes', 'main', 'function1', @@ -442,9 +442,9 @@ export const heapProfileWithExternal = new Profile({ location: heapLocationsWithExternal, function: heapFunctionsWithExternal, stringTable: buildStringTable([ - 'objects', + 'inuse_objects', 'count', - 'space', + 'inuse_space', 'bytes', '(external)', 'main', @@ -517,9 +517,9 @@ export const anonymousFunctionHeapProfile = new Profile({ location: anonymousFunctionHeapLocations, function: anonymousFunctionHeapFunctions, stringTable: buildStringTable([ - 'objects', + 'inuse_objects', 'count', - 'space', + 'inuse_space', 'bytes', '(anonymous:L#1:C#5)', 'main', @@ -741,9 +741,9 @@ export const heapProfileIncludePath = new Profile({ location: heapIncludePathLocations, function: heapIncludePathFunctions, stringTable: buildStringTable([ - 'objects', + 'inuse_objects', 'count', - 'space', + 'inuse_space', 'bytes', 'baz', 'foo.ts', @@ -805,9 +805,9 @@ export const heapProfileIncludePathWithLabels = new Profile({ location: heapIncludePathLocations, function: heapIncludePathFunctions, stringTable: buildStringTable([ - 'objects', + 'inuse_objects', 'count', - 'space', + 'inuse_space', 'bytes', 'baz', 'foo.ts', @@ -871,9 +871,9 @@ export const heapProfileExcludePath = new Profile({ location: heapExcludePathLocations, function: heapExcludePathFunctions, stringTable: buildStringTable([ - 'objects', + 'inuse_objects', 'count', - 'space', + 'inuse_space', 'bytes', 'baz', 'foo.ts', @@ -1043,9 +1043,9 @@ export const heapSourceProfile = new Profile({ location: heapSourceLocations, function: heapSourceFunctions, stringTable: buildStringTable([ - 'objects', + 'inuse_objects', 'count', - 'space', + 'inuse_space', 'bytes', 'foo1', path.join(mapDirPath, 'foo.ts'),