|
@@ -1,8 +1,9 @@
|
|
|
import {Location} from 'history';
|
|
|
|
|
|
import {COL_WIDTH_UNDEFINED} from 'app/components/gridEditable';
|
|
|
+import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader';
|
|
|
import {t} from 'app/locale';
|
|
|
-import {LightWeightOrganization, NewQuery, SelectValue} from 'app/types';
|
|
|
+import {LightWeightOrganization, NewQuery, Project, SelectValue} from 'app/types';
|
|
|
import EventView from 'app/utils/discover/eventView';
|
|
|
import {decodeScalar} from 'app/utils/queryString';
|
|
|
import {tokenizeSearch} from 'app/utils/tokenizeSearch';
|
|
@@ -537,7 +538,9 @@ function generateBackendPerformanceEventView(
|
|
|
|
|
|
function generateMobilePerformanceEventView(
|
|
|
organization: LightWeightOrganization,
|
|
|
- location: Location
|
|
|
+ location: Location,
|
|
|
+ projects: Project[],
|
|
|
+ genericEventView: EventView
|
|
|
): EventView {
|
|
|
const {query} = location;
|
|
|
|
|
@@ -551,9 +554,24 @@ function generateMobilePerformanceEventView(
|
|
|
'p75(measurements.app_start_warm)',
|
|
|
'p75(measurements.frames_slow_rate)',
|
|
|
'p75(measurements.frames_frozen_rate)',
|
|
|
- 'p75(measurements.stall_percentage)',
|
|
|
];
|
|
|
|
|
|
+ // At this point, all projects are mobile projects.
|
|
|
+ // If in addition to that, all projects are react-native projects,
|
|
|
+ // then show the stall percentage as well.
|
|
|
+ const projectIds = genericEventView.project;
|
|
|
+ if (projectIds.length > 0 && projectIds[0] !== ALL_ACCESS_PROJECTS) {
|
|
|
+ const selectedProjects = projects.filter(p =>
|
|
|
+ projectIds.includes(parseInt(p.id, 10))
|
|
|
+ );
|
|
|
+ if (
|
|
|
+ selectedProjects.length > 0 &&
|
|
|
+ selectedProjects.every(project => project.platform === 'react-native')
|
|
|
+ ) {
|
|
|
+ fields.push('p75(measurements.stall_percentage)');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const featureFields = organization.features.includes('project-transaction-threshold')
|
|
|
? ['count_unique(user)', 'count_miserable(user)', 'user_misery()']
|
|
|
: [
|
|
@@ -759,7 +777,12 @@ export function generatePerformanceEventView(
|
|
|
case LandingDisplayField.BACKEND:
|
|
|
return generateBackendPerformanceEventView(organization, location);
|
|
|
case LandingDisplayField.MOBILE:
|
|
|
- return generateMobilePerformanceEventView(organization, location);
|
|
|
+ return generateMobilePerformanceEventView(
|
|
|
+ organization,
|
|
|
+ location,
|
|
|
+ projects,
|
|
|
+ eventView
|
|
|
+ );
|
|
|
default:
|
|
|
return eventView;
|
|
|
}
|