You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/core/src/profiling.ts
-52Lines changed: 0 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,6 @@ function isProfilingIntegrationWithProfiler(
18
18
* Starts the Sentry continuous profiler.
19
19
* This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value.
20
20
* In continuous profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling of the application.
21
-
* @deprecated Use `startProfileSession()` instead.
22
21
*/
23
22
functionstartProfiler(): void{
24
23
constclient=getClient();
@@ -45,7 +44,6 @@ function startProfiler(): void {
45
44
/**
46
45
* Stops the Sentry continuous profiler.
47
46
* Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.
48
-
* @deprecated Use `stopProfilerSession()` instead.
49
47
*/
50
48
functionstopProfiler(): void{
51
49
constclient=getClient();
@@ -68,57 +66,7 @@ function stopProfiler(): void {
68
66
integration._profiler.stop();
69
67
}
70
68
71
-
/**
72
-
* Starts a new profiler session.
73
-
*/
74
-
functionstartProfileSession(): void{
75
-
constclient=getClient();
76
-
if(!client){
77
-
DEBUG_BUILD&&logger.warn('No Sentry client available, profiling is not started');
Copy file name to clipboardExpand all lines: packages/profiling-node/src/integration.ts
+15-5Lines changed: 15 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ class ContinuousProfiler {
108
108
break;
109
109
}
110
110
case'manual': {
111
-
// Manual mode requires manual calls to profiler.startProfileSession() and profiler.stopProfileSession()
111
+
// Manual mode requires manual calls to profiler.startProfiler() and profiler.stopProfiler()
112
112
break;
113
113
}
114
114
default: {
@@ -136,6 +136,11 @@ class ContinuousProfiler {
136
136
* @returns void
137
137
*/
138
138
publicstart(): void{
139
+
if(this._mode==='current'){
140
+
this.startProfiler();
141
+
return;
142
+
}
143
+
139
144
if(!this._client){
140
145
DEBUG_BUILD&&logger.log('[Profiling] Failed to start, sentry client was never attached to the profiler.');
141
146
return;
@@ -165,6 +170,11 @@ class ContinuousProfiler {
165
170
* @returns void
166
171
*/
167
172
publicstop(): void{
173
+
if(this._mode==='current'){
174
+
this.stopProfiler();
175
+
return;
176
+
}
177
+
168
178
if(!this._client){
169
179
DEBUG_BUILD&&logger.log('[Profiling] Failed to stop, sentry client was never attached to the profiler.');
170
180
return;
@@ -184,7 +194,7 @@ class ContinuousProfiler {
184
194
this._teardownSpanChunkInstrumentation();
185
195
}
186
196
187
-
publicstartProfileSession(): void{
197
+
privatestartProfiler(): void{
188
198
if(this._mode!=='current'){
189
199
DEBUG_BUILD&&logger.log('[Profiling] Continuous profiling is not supported in the current mode.');
190
200
return;
@@ -205,15 +215,15 @@ class ContinuousProfiler {
205
215
if(this._profileLifecycle==='trace'){
206
216
DEBUG_BUILD&&
207
217
logger.log(
208
-
'[Profiling] You are using the trace profile lifecycle, manual calls to profiler.startProfileSession() and profiler.stopProfileSession() will be ignored.',
218
+
'[Profiling] You are using the trace profile lifecycle, manual calls to profiler.startProfiler() and profiler.stopProfiler() will be ignored.',
209
219
);
210
220
return;
211
221
}
212
222
213
223
this._startChunkProfiling();
214
224
}
215
225
216
-
publicstopProfileSession(): void{
226
+
privatestopProfiler(): void{
217
227
if(this._mode!=='current'){
218
228
DEBUG_BUILD&&logger.log('[Profiling] Continuous profiling is not supported in the current mode.');
219
229
return;
@@ -222,7 +232,7 @@ class ContinuousProfiler {
222
232
if(this._profileLifecycle==='trace'){
223
233
DEBUG_BUILD&&
224
234
logger.log(
225
-
'[Profiling] You are using the trace profile lifecycle, manual calls to profiler.startProfileSession() and profiler.stopProfileSession() will be ignored.',
235
+
'[Profiling] You are using the trace profile lifecycle, manual calls to profiler.startProfiler() and profiler.stopProfiler() will be ignored.',
it('profiler.start, profiler.stop, profiler.startProfileSession, profiler.stopProfileSession void in automated span profiling mode',()=>{
992
+
it('profiler.start, profiler.stop, profiler.startProfiler, profiler.stopProfiler void in automated span profiling mode',()=>{
993
993
const[client]=makeLegacySpanProfilingClient();
994
994
Sentry.setCurrentClient(client);
995
995
client.init();
@@ -1005,8 +1005,8 @@ describe('Legacy vs Current API compat', () => {
1005
1005
expect(stopProfilingSpy).not.toHaveBeenCalled();
1006
1006
1007
1007
// This API is not supported in legacy mode
1008
-
Sentry.profiler.startProfileSession();
1009
-
Sentry.profiler.stopProfileSession();
1008
+
Sentry.profiler.startProfiler();
1009
+
Sentry.profiler.stopProfiler();
1010
1010
1011
1011
expect(startProfilingSpy).not.toHaveBeenCalled();
1012
1012
expect(stopProfilingSpy).not.toHaveBeenCalled();
@@ -1021,7 +1021,7 @@ describe('Legacy vs Current API compat', () => {
1021
1021
});
1022
1022
1023
1023
describe('continuous profiling',()=>{
1024
-
it('profiler.start and profiler.stop start and stop the profiler, calls to profiler.startProfileSession and profiler.stopProfileSession are ignored',()=>{
1024
+
it('profiler.start and profiler.stop start and stop the profiler, calls to profiler.startProfiler and profiler.stopProfiler are ignored',()=>{
0 commit comments