-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(perf): Finish remaining landing v3 views #29715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
79f10d1
c256c1a
c80c831
5edac02
60e8cd8
88bf69c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import min from 'lodash/min'; | |
|
|
||
| import AreaChart from 'app/components/charts/areaChart'; | ||
| import ChartZoom from 'app/components/charts/chartZoom'; | ||
| import LineChart from 'app/components/charts/lineChart'; | ||
| import {DateString} from 'app/types'; | ||
| import {Series} from 'app/types/echarts'; | ||
| import {axisLabelFormatter, tooltipFormatter} from 'app/utils/discover/charts'; | ||
|
|
@@ -24,6 +25,7 @@ type Props = { | |
| disableXAxis?: boolean; | ||
| chartColors?: string[]; | ||
| loading: boolean; | ||
| isLineChart?: boolean; | ||
| }; | ||
|
|
||
| // adapted from https://stackoverflow.com/questions/11397239/rounding-up-for-a-graph-maximum | ||
|
|
@@ -68,6 +70,7 @@ function Chart({ | |
| disableMultiAxis, | ||
| disableXAxis, | ||
| chartColors, | ||
| isLineChart, | ||
| }: Props) { | ||
| const theme = useTheme(); | ||
|
|
||
|
|
@@ -176,6 +179,9 @@ function Chart({ | |
| }; | ||
|
|
||
| if (loading) { | ||
| if (isLineChart) { | ||
| return <LineChart height={height} series={[]} {...areaChartProps} />; | ||
| } | ||
|
Comment on lines
+182
to
+184
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be a follow-up, but I think we typically use the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The transparent loading mask should only appear on reload state, which I'm thinking of handling in performance widget under the hood, instead of in these charts. |
||
| return <AreaChart height={height} series={[]} {...areaChartProps} />; | ||
| } | ||
| const series = data.map((values, i: number) => ({ | ||
|
|
@@ -193,16 +199,31 @@ function Chart({ | |
| utc={utc} | ||
| xAxisIndex={disableMultiAxis ? undefined : [0, 1]} | ||
| > | ||
| {zoomRenderProps => ( | ||
| <AreaChart | ||
| height={height} | ||
| {...zoomRenderProps} | ||
| series={series} | ||
| previousPeriod={previousData} | ||
| xAxis={disableXAxis ? {show: false} : undefined} | ||
| {...areaChartProps} | ||
| /> | ||
| )} | ||
| {zoomRenderProps => { | ||
| if (isLineChart) { | ||
| return ( | ||
| <LineChart | ||
| height={height} | ||
| {...zoomRenderProps} | ||
| series={series} | ||
| previousPeriod={previousData} | ||
| xAxis={disableXAxis ? {show: false} : undefined} | ||
| {...areaChartProps} | ||
Zylphrex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <AreaChart | ||
| height={height} | ||
| {...zoomRenderProps} | ||
| series={series} | ||
| previousPeriod={previousData} | ||
| xAxis={disableXAxis ? {show: false} : undefined} | ||
| {...areaChartProps} | ||
| /> | ||
| ); | ||
| }} | ||
| </ChartZoom> | ||
| ); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,6 +52,7 @@ export enum PERFORMANCE_TERM { | |
| STALL_PERCENTAGE = 'stallPercentage', | ||
| MOST_ISSUES = 'mostIssues', | ||
| MOST_ERRORS = 'mostErrors', | ||
| SLOW_HTTP_SPANS = 'slowHTTPSpans', | ||
| } | ||
|
|
||
| export type TooltipOption = SelectValue<string> & { | ||
|
|
@@ -361,6 +362,7 @@ export const PERFORMANCE_TERMS: Record<PERFORMANCE_TERM, TermFormatter> = { | |
| frozenFrames: () => t('The count of the number of frozen frames in the transaction.'), | ||
| mostErrors: () => t('Transactions with the most associated errors.'), | ||
| mostIssues: () => t('The most instances of an issue for a related transaction.'), | ||
| slowHTTPSpans: () => t('The transactions with the slowest spans of a certain type.'), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should there be custom messages for each type?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. Thanks for reminding me. |
||
| stallPercentage: () => | ||
| t( | ||
| 'The percentage of the transaction duration in which the application is in a stalled state.' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,47 @@ | ||
| import {usePageError} from 'app/utils/performance/contexts/pageError'; | ||
| import {PerformanceDisplayProvider} from 'app/utils/performance/contexts/performanceDisplayContext'; | ||
|
|
||
| import Table from '../../table'; | ||
| import {PROJECT_PERFORMANCE_TYPE} from '../../utils'; | ||
| import {BACKEND_COLUMN_TITLES} from '../data'; | ||
| import {DoubleChartRow, TripleChartRow} from '../widgets/components/widgetChartRow'; | ||
| import {PerformanceWidgetSetting} from '../widgets/widgetDefinitions'; | ||
|
|
||
| import {BasePerformanceViewProps} from './types'; | ||
|
|
||
| export function BackendView(props: BasePerformanceViewProps) { | ||
| return ( | ||
| <div> | ||
| <Table | ||
| {...props} | ||
| columnTitles={BACKEND_COLUMN_TITLES} | ||
| setError={usePageError().setPageError} | ||
| /> | ||
| </div> | ||
| <PerformanceDisplayProvider value={{performanceType: PROJECT_PERFORMANCE_TYPE.ANY}}> | ||
| <div> | ||
| <TripleChartRow | ||
| {...props} | ||
| allowedCharts={[ | ||
| PerformanceWidgetSetting.APDEX_AREA, | ||
| PerformanceWidgetSetting.TPM_AREA, | ||
| PerformanceWidgetSetting.FAILURE_RATE_AREA, | ||
| PerformanceWidgetSetting.USER_MISERY_AREA, | ||
| PerformanceWidgetSetting.P50_DURATION_AREA, | ||
| PerformanceWidgetSetting.P75_DURATION_AREA, | ||
| PerformanceWidgetSetting.P95_DURATION_AREA, | ||
| PerformanceWidgetSetting.P99_DURATION_AREA, | ||
| PerformanceWidgetSetting.DURATION_HISTOGRAM, | ||
| ]} | ||
| /> | ||
| <DoubleChartRow | ||
| {...props} | ||
| allowedCharts={[ | ||
| PerformanceWidgetSetting.SLOW_HTTP_OPS, | ||
| PerformanceWidgetSetting.SLOW_DB_OPS, | ||
| PerformanceWidgetSetting.MOST_IMPROVED, | ||
| PerformanceWidgetSetting.MOST_REGRESSED, | ||
| ]} | ||
| /> | ||
| <Table | ||
| {...props} | ||
| columnTitles={BACKEND_COLUMN_TITLES} | ||
| setError={usePageError().setPageError} | ||
| /> | ||
| </div> | ||
| </PerformanceDisplayProvider> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,43 @@ | ||
| import {usePageError} from 'app/utils/performance/contexts/pageError'; | ||
| import {PerformanceDisplayProvider} from 'app/utils/performance/contexts/performanceDisplayContext'; | ||
|
|
||
| import Table from '../../table'; | ||
| import {PROJECT_PERFORMANCE_TYPE} from '../../utils'; | ||
| import {MOBILE_COLUMN_TITLES} from '../data'; | ||
| import {DoubleChartRow, TripleChartRow} from '../widgets/components/widgetChartRow'; | ||
| import {PerformanceWidgetSetting} from '../widgets/widgetDefinitions'; | ||
|
|
||
| import {BasePerformanceViewProps} from './types'; | ||
|
|
||
| export function MobileView(props: BasePerformanceViewProps) { | ||
| return ( | ||
| <div> | ||
| <Table | ||
| {...props} | ||
| columnTitles={MOBILE_COLUMN_TITLES} // TODO(k-fish): Add react native column titles | ||
| setError={usePageError().setPageError} | ||
| /> | ||
| </div> | ||
| <PerformanceDisplayProvider value={{performanceType: PROJECT_PERFORMANCE_TYPE.ANY}}> | ||
| <div> | ||
| <TripleChartRow | ||
| {...props} | ||
| allowedCharts={[ | ||
| PerformanceWidgetSetting.TPM_AREA, | ||
| PerformanceWidgetSetting.COLD_STARTUP_AREA, | ||
| PerformanceWidgetSetting.WARM_STARTUP_AREA, | ||
| PerformanceWidgetSetting.SLOW_FRAMES_AREA, | ||
| PerformanceWidgetSetting.FROZEN_FRAMES_AREA, | ||
| ]} | ||
| /> | ||
| <DoubleChartRow | ||
| {...props} | ||
| allowedCharts={[ | ||
| PerformanceWidgetSetting.MOST_SLOW_FRAMES, | ||
| PerformanceWidgetSetting.MOST_FROZEN_FRAMES, | ||
| PerformanceWidgetSetting.MOST_IMPROVED, | ||
| PerformanceWidgetSetting.MOST_REGRESSED, | ||
| ]} | ||
| /> | ||
| <Table | ||
| {...props} | ||
| columnTitles={MOBILE_COLUMN_TITLES} // TODO(k-fish): Add react native column titles | ||
| setError={usePageError().setPageError} | ||
| /> | ||
| </div> | ||
| </PerformanceDisplayProvider> | ||
| ); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.