Skip to content

Commit f2ba12b

Browse files
authored
Add total allocated bytes to MemoryInfoContext (#93013)
<!-- Describe your PR here. --> Adds the `total_allocated_bytes` property added in getsentry/sentry-dotnet#4243 to the static types. cc @jamescrosswell <!-- Sentry employees and contractors can delete or ignore the following. --> ### Legal Boilerplate Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
1 parent f2098c1 commit f2ba12b

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

static/app/components/events/contexts/knownContext/memoryInfo.spec.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const MOCK_MEMORY_INFO_CONTEXT = {
1515
memory_load_bytes: 1048576 * 6,
1616
total_committed_bytes: 1048576 * 7,
1717
promoted_bytes: 1048576 * 8,
18+
total_allocated_bytes: 1048576 * 9,
1819
pinned_objects_count: 150,
1920
pause_time_percentage: 25.5,
2021
index: 12,
@@ -55,6 +56,7 @@ describe('MemoryInfoContext', function () {
5556
{key: 'memory_load_bytes', subject: 'Memory Load Bytes', value: '6.0 MiB'},
5657
{key: 'total_committed_bytes', subject: 'Total Committed Bytes', value: '7.0 MiB'},
5758
{key: 'promoted_bytes', subject: 'Promoted Bytes', value: '8.0 MiB'},
59+
{key: 'total_allocated_bytes', subject: 'Total Allocated Bytes', value: '9.0 MiB'},
5860
{key: 'pinned_objects_count', subject: 'Pinned Objects Count', value: 150},
5961
{key: 'pause_time_percentage', subject: 'Pause Time Percentage', value: 25.5},
6062
{key: 'index', subject: 'Index', value: 12},

static/app/components/events/contexts/knownContext/memoryInfo.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ export function getMemoryInfoContext({
2626
subject: t('Allocated Bytes'),
2727
value: data.allocated_bytes ? formatMemory(data.allocated_bytes) : undefined,
2828
};
29+
case MemoryInfoContextKey.TOTAL_ALLOCATED_BYTES:
30+
return {
31+
key: ctxKey,
32+
subject: t('Total Allocated Bytes'),
33+
value: data.total_allocated_bytes
34+
? formatMemory(data.total_allocated_bytes)
35+
: undefined,
36+
};
2937
case MemoryInfoContextKey.FRAGMENTED_BYTES:
3038
return {
3139
key: ctxKey,

static/app/types/event.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ export interface UnityContext {
548548

549549
export enum MemoryInfoContextKey {
550550
ALLOCATED_BYTES = 'allocated_bytes',
551+
TOTAL_ALLOCATED_BYTES = 'total_allocated_bytes',
551552
FRAGMENTED_BYTES = 'fragmented_bytes',
552553
HEAP_SIZE_BYTES = 'heap_size_bytes',
553554
HIGH_MEMORY_LOAD_THRESHOLD_BYTES = 'high_memory_load_threshold_bytes',
@@ -580,6 +581,7 @@ export interface MemoryInfoContext {
580581
[MemoryInfoContextKey.PAUSE_TIME_PERCENTAGE]?: number;
581582
[MemoryInfoContextKey.INDEX]?: number;
582583
[MemoryInfoContextKey.ALLOCATED_BYTES]?: number;
584+
[MemoryInfoContextKey.TOTAL_ALLOCATED_BYTES]?: number;
583585
[MemoryInfoContextKey.FRAGMENTED_BYTES]?: number;
584586
[MemoryInfoContextKey.HEAP_SIZE_BYTES]?: number;
585587
[MemoryInfoContextKey.HIGH_MEMORY_LOAD_THRESHOLD_BYTES]?: number;

0 commit comments

Comments
 (0)