Browse Source

ref(perf-issues): Rename slow span to slow DB query in frontend (#43434)

Ash Anand 2 years ago
parent
commit
25f7fc7ede

+ 3 - 3
static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.spec.tsx

@@ -222,7 +222,7 @@ describe('SpanEvidenceKeyValueList', () => {
     const builder = new TransactionEventBuilder(
       'a1',
       '/',
-      IssueType.PERFORMANCE_SLOW_SPAN
+      IssueType.PERFORMANCE_SLOW_DB_QUERY
     );
 
     const parentSpan = new MockSpan({
@@ -250,9 +250,9 @@ describe('SpanEvidenceKeyValueList', () => {
         screen.getByTestId('span-evidence-key-value-list.transaction')
       ).toHaveTextContent('/');
 
-      expect(screen.getByRole('cell', {name: 'Slow Span'})).toBeInTheDocument();
+      expect(screen.getByRole('cell', {name: 'Slow DB Query'})).toBeInTheDocument();
       expect(
-        screen.getByTestId('span-evidence-key-value-list.slow-span')
+        screen.getByTestId('span-evidence-key-value-list.slow-db-query')
       ).toHaveTextContent('SELECT pokemon FROM pokedex');
     });
   });

+ 3 - 3
static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx

@@ -51,7 +51,7 @@ export function SpanEvidenceKeyValueList({event}: {event: EventTransaction}) {
     {
       [IssueType.PERFORMANCE_N_PLUS_ONE_DB_QUERIES]: NPlusOneDBQueriesSpanEvidence,
       [IssueType.PERFORMANCE_N_PLUS_ONE_API_CALLS]: NPlusOneAPICallsSpanEvidence,
-      [IssueType.PERFORMANCE_SLOW_SPAN]: SlowSpanSpanEvidence,
+      [IssueType.PERFORMANCE_SLOW_DB_QUERY]: SlowDBQueryEvidence,
       [IssueType.PERFORMANCE_CONSECUTIVE_DB_QUERIES]: ConsecutiveDBQueriesSpanEvidence,
       [IssueType.PERFORMANCE_RENDER_BLOCKING_ASSET]: RenderBlockingAssetSpanEvidence,
     }[performanceProblem.issueType] ?? DefaultSpanEvidence;
@@ -129,11 +129,11 @@ const isRequestEntry = (entry: Entry): entry is EntryRequest => {
   return entry.type === EntryType.REQUEST;
 };
 
-const SlowSpanSpanEvidence = ({event, offendingSpans}: SpanEvidenceKeyValueListProps) => (
+const SlowDBQueryEvidence = ({event, offendingSpans}: SpanEvidenceKeyValueListProps) => (
   <PresortedKeyValueList
     data={[
       makeTransactionNameRow(event),
-      makeRow(t('Slow Span'), getSpanEvidenceValue(offendingSpans[0])),
+      makeRow(t('Slow DB Query'), getSpanEvidenceValue(offendingSpans[0])),
     ]}
   />
 );

+ 3 - 3
static/app/components/events/interfaces/performance/utils.tsx

@@ -29,7 +29,7 @@ const RESOURCES_DESCRIPTIONS: Record<IssueType, string> = {
   [IssueType.PERFORMANCE_FILE_IO_MAIN_THREAD]: t(
     'File IO operations on your main thread may cause app hangs.'
   ),
-  [IssueType.PERFORMANCE_SLOW_SPAN]: t(
+  [IssueType.PERFORMANCE_SLOW_DB_QUERY]: t(
     'Slow DB Queries are SELECT query spans that take longer than 1s. A quick method to understand why this may be the case is running an EXPLAIN command on the query itself. To learn more about how to fix slow DB queries, check out these resources:'
   ),
   [IssueType.PERFORMANCE_RENDER_BLOCKING_ASSET]: t(
@@ -64,7 +64,7 @@ const DEFAULT_RESOURCE_LINK: Record<IssueType, ResourceLink[]> = {
   ],
   [IssueType.PERFORMANCE_UNCOMPRESSED_ASSET]: [],
   [IssueType.PERFORMANCE_FILE_IO_MAIN_THREAD]: [],
-  [IssueType.PERFORMANCE_SLOW_SPAN]: [],
+  [IssueType.PERFORMANCE_SLOW_DB_QUERY]: [],
   [IssueType.PERFORMANCE_RENDER_BLOCKING_ASSET]: [
     {
       text: t('Web Vital: First Contentful Paint'),
@@ -93,7 +93,7 @@ const RESOURCE_LINKS: Record<IssueType, PlatformSpecificResources> = {
   [IssueType.PERFORMANCE_N_PLUS_ONE_API_CALLS]: {},
   [IssueType.PERFORMANCE_CONSECUTIVE_DB_QUERIES]: {},
   [IssueType.PERFORMANCE_FILE_IO_MAIN_THREAD]: {},
-  [IssueType.PERFORMANCE_SLOW_SPAN]: {},
+  [IssueType.PERFORMANCE_SLOW_DB_QUERY]: {},
   [IssueType.PERFORMANCE_UNCOMPRESSED_ASSET]: {},
   [IssueType.PERFORMANCE_RENDER_BLOCKING_ASSET]: {},
   [IssueType.ERROR]: {},

+ 1 - 1
static/app/types/group.tsx

@@ -60,8 +60,8 @@ export enum IssueType {
   PERFORMANCE_FILE_IO_MAIN_THREAD = 'performance_file_io_main_thread',
   PERFORMANCE_N_PLUS_ONE_API_CALLS = 'performance_n_plus_one_api_calls',
   PERFORMANCE_N_PLUS_ONE_DB_QUERIES = 'performance_n_plus_one_db_queries',
+  PERFORMANCE_SLOW_DB_QUERY = 'performance_slow_db_query',
   PERFORMANCE_RENDER_BLOCKING_ASSET = 'performance_render_blocking_asset_span',
-  PERFORMANCE_SLOW_SPAN = 'performance_slow_span',
   PERFORMANCE_UNCOMPRESSED_ASSET = 'performance_uncompressed_assets',
 }
 

+ 8 - 8
static/app/views/admin/adminSettings.tsx

@@ -34,10 +34,10 @@ const optionsAvailable = [
   'performance.issues.compressed_assets.ea-rollout',
   'performance.issues.compressed_assets.ga-rollout',
   'performance.issues.file_io_main_thread.problem-creation',
-  'performance.issues.slow_span.problem-creation',
-  'performance.issues.slow_span.la-rollout',
-  'performance.issues.slow_span.ea-rollout',
-  'performance.issues.slow_span.ga-rollout',
+  'performance.issues.slow_db_query.problem-creation',
+  'performance.issues.slow_db_query.la-rollout',
+  'performance.issues.slow_db_query.ea-rollout',
+  'performance.issues.slow_db_query.ga-rollout',
 ];
 
 type Field = ReturnType<typeof getOption>;
@@ -145,10 +145,10 @@ export default class AdminSettings extends AsyncView<{}, State> {
             </Panel>
             <Panel>
               <PanelHeader>Performance Issues - Slow DB Span Detector</PanelHeader>
-              {fields['performance.issues.slow_span.problem-creation']}
-              {fields['performance.issues.slow_span.la-rollout']}
-              {fields['performance.issues.slow_span.ea-rollout']}
-              {fields['performance.issues.slow_span.ga-rollout']}
+              {fields['performance.issues.slow_db_query.problem-creation']}
+              {fields['performance.issues.slow_db_query.la-rollout']}
+              {fields['performance.issues.slow_db_query.ea-rollout']}
+              {fields['performance.issues.slow_db_query.ga-rollout']}
             </Panel>
           </Feature>
         </Form>

+ 4 - 4
static/app/views/admin/options.tsx

@@ -280,7 +280,7 @@ const performanceOptionDefinitions: Field[] = [
     ...HIGH_THROUGHPUT_RATE_OPTION,
   },
   {
-    key: 'performance.issues.slow_span.problem-creation',
+    key: 'performance.issues.slow_db_query.problem-creation',
     label: t('Problem Creation Rate'),
     help: t(
       'Controls the overall rate at which performance problems are detected by the slow DB span detector.'
@@ -288,7 +288,7 @@ const performanceOptionDefinitions: Field[] = [
     ...HIGH_THROUGHPUT_RATE_OPTION,
   },
   {
-    key: 'performance.issues.slow_span.la-rollout',
+    key: 'performance.issues.slow_db_query.la-rollout',
     label: t('Limited Availability Detection Rate'),
     help: t(
       'Controls the rate at which performance problems are detected by the slow DB span detector for LA organizations.'
@@ -296,7 +296,7 @@ const performanceOptionDefinitions: Field[] = [
     ...HIGH_THROUGHPUT_RATE_OPTION,
   },
   {
-    key: 'performance.issues.slow_span.ea-rollout',
+    key: 'performance.issues.slow_db_query.ea-rollout',
     label: t('Early Adopter Detection Rate'),
     help: t(
       'Controls the rate at which performance problems are detected by the slow DB span detector for EA organizations.'
@@ -304,7 +304,7 @@ const performanceOptionDefinitions: Field[] = [
     ...HIGH_THROUGHPUT_RATE_OPTION,
   },
   {
-    key: 'performance.issues.slow_span.ga-rollout',
+    key: 'performance.issues.slow_db_query.ga-rollout',
     label: t('General Availability Detection Rate'),
     help: t(
       'Controls the rate at which performance problems are detected by the slow DB span detector for GA organizations.'

+ 2 - 2
static/app/views/organizationGroupDetails/header.tsx

@@ -266,10 +266,10 @@ function GroupHeader({
             title="N+1 API Calls Performance Issues are in active development and may change"
           />
         )}
-        {group.issueType === IssueType.PERFORMANCE_SLOW_SPAN && (
+        {group.issueType === IssueType.PERFORMANCE_SLOW_DB_QUERY && (
           <FeatureBadge
             type="alpha"
-            title="Slow DB Span Performance Issues are in active development and may change"
+            title="Slow DB Query Performance Issues are in active development and may change"
           />
         )}
         {group.issueType === IssueType.PERFORMANCE_CONSECUTIVE_DB_QUERIES && (