Browse Source

fix(onboarding): fix python code snippet start_profiling -> start_profiler (#79883)

Simon Hellmayr 4 months ago
parent
commit
b80c488fdc

+ 4 - 4
static/app/gettingStartedDocs/python/python.spec.tsx

@@ -42,10 +42,10 @@ describe('python onboarding docs', function () {
 
     // Does not render continuous profiling config
     expect(
-      screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.start_profiling\(\)/))
+      screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.start_profiler\(\)/))
     ).not.toBeInTheDocument();
     expect(
-      screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.stop_profiling\(\)/))
+      screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.stop_profiler\(\)/))
     ).not.toBeInTheDocument();
 
     // Does render transaction profiling config
@@ -74,10 +74,10 @@ describe('python onboarding docs', function () {
 
     // Does render continuous profiling config
     expect(
-      screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.start_profiling\(\)/))
+      screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.start_profiler\(\)/))
     ).toBeInTheDocument();
     expect(
-      screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.stop_profiling\(\)/))
+      screen.queryByText(textWithMarkupMatcher(/sentry_sdk.profiler.stop_profiler\(\)/))
     ).toBeInTheDocument();
   });
 });

+ 3 - 3
static/app/gettingStartedDocs/python/python.tsx

@@ -44,11 +44,11 @@ sentry_sdk.init(
   params.profilingOptions?.defaultProfilingMode === 'continuous'
     ? `
 
-# Manually call start_profiling and stop_profiling
+# Manually call start_profiler and stop_profiler
 # to profile the code in between
-sentry_sdk.profiler.start_profiling()
+sentry_sdk.profiler.start_profiler()
 # do some work here
-sentry_sdk.profiler.stop_profiling()`
+sentry_sdk.profiler.stop_profiler()`
     : ''
 }`;