Skip to content

Commit d804dd4

Browse files
authored
chore(profiling-node): Remove duplicate types (#15427)
These types were moved to `@sentry-internal/node-cpu-profiler` but I didn't remove them here during the migration.
1 parent 6c69710 commit d804dd4

File tree

5 files changed

+9
-92
lines changed

5 files changed

+9
-92
lines changed

packages/profiling-node/src/integration.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* eslint-disable max-lines */
2-
3-
import { CpuProfilerBindings } from '@sentry-internal/node-cpu-profiler';
2+
import { CpuProfilerBindings, ProfileFormat, type RawThreadCpuProfile } from '@sentry-internal/node-cpu-profiler';
43
import type { Event, IntegrationFn, Profile, ProfileChunk, ProfilingIntegration, Span } from '@sentry/core';
54
import {
65
LRUMap,
@@ -18,8 +17,6 @@ import type { NodeClient } from '@sentry/node';
1817
import { DEBUG_BUILD } from './debug-build';
1918
import { NODE_MAJOR, NODE_VERSION } from './nodeVersion';
2019
import { MAX_PROFILE_DURATION_MS, maybeProfileSpan, stopSpanProfile } from './spanProfileUtils';
21-
import type { RawThreadCpuProfile } from './types';
22-
import { ProfileFormat } from './types';
2320
import {
2421
PROFILER_THREAD_ID_STRING,
2522
PROFILER_THREAD_NAME,

packages/profiling-node/src/spanProfileUtils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { CpuProfilerBindings } from '@sentry-internal/node-cpu-profiler';
1+
import { CpuProfilerBindings, type RawThreadCpuProfile } from '@sentry-internal/node-cpu-profiler';
22
import type { CustomSamplingContext, Span } from '@sentry/core';
33
import { logger, spanIsSampled, spanToJSON, uuid4 } from '@sentry/core';
44
import type { NodeClient } from '@sentry/node';
55
import { DEBUG_BUILD } from './debug-build';
6-
import type { RawThreadCpuProfile } from './types';
76
import { isValidSampleRate } from './utils';
87

98
export const MAX_PROFILE_DURATION_MS = 30 * 1000;

packages/profiling-node/src/types.ts

Lines changed: 0 additions & 84 deletions
This file was deleted.

packages/profiling-node/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import {
2727
import { env, versions } from 'process';
2828
import { isMainThread, threadId } from 'worker_threads';
2929

30+
import type { RawChunkCpuProfile, RawThreadCpuProfile } from '@sentry-internal/node-cpu-profiler';
3031
import { DEBUG_BUILD } from './debug-build';
31-
import type { RawChunkCpuProfile, RawThreadCpuProfile } from './types';
3232

3333
// We require the file because if we import it, it will be included in the bundle.
3434
// I guess tsc does not check file contents when it's imported.

packages/profiling-node/test/utils.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
import { addItemToEnvelope, createEnvelope, uuid4 } from '@sentry/core';
22
import type { Event } from '@sentry/core';
33

4+
import type { RawThreadCpuProfile } from '@sentry-internal/node-cpu-profiler';
45
import {
56
addProfilesToEnvelope,
67
findProfiledTransactionsFromEnvelope,
78
isValidProfile,
89
isValidSampleRate,
910
} from '../src/utils';
1011

11-
import type { ProfiledEvent } from '../src/types';
12+
interface ProfiledEvent extends Event {
13+
sdkProcessingMetadata: {
14+
profile?: RawThreadCpuProfile;
15+
};
16+
}
1217

1318
function makeProfile(
1419
props: Partial<ProfiledEvent['sdkProcessingMetadata']['profile']>,

0 commit comments

Comments
 (0)