Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions ts/src/profile-serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -646,8 +624,8 @@ export function serializeHeapProfile(
createAllocatedSpaceValueType(stringTable),
]
: [
createObjectCountValueType(stringTable),
createAllocationValueType(stringTable),
createInUseObjectCountValueType(stringTable),
createInUseSpaceValueType(stringTable),
];

const profile = {
Expand Down
28 changes: 14 additions & 14 deletions ts/test/profiles-for-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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'),
Expand Down
Loading