Skip to content

Commit cae851c

Browse files
committed
fix: simplified step name
1 parent bd6949d commit cae851c

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

Diff for: __tests__/userJourney/measureUserJourneyStep.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ describe('measureUserJourneyStep', () => {
108108
);
109109
expect(measureSpy).toHaveBeenCalledTimes(2);
110110
expect(measureSpy).toHaveBeenCalledWith(
111-
'user_journey_step.load_second_screen_first_journey',
111+
'step.load_second_screen_first_journey',
112112
'mark.start_navigate_to_second_screen_first_journey',
113113
'mark.loaded_second_screen_first_journey',
114114
);
115115
expect(measureSpy).toHaveBeenLastCalledWith(
116-
'user_journey_step.load_second_screen_first_journey_vitals_good',
116+
'step.load_second_screen_first_journey_vitals_good',
117117
{
118118
detail: {
119119
duration: 100,
@@ -125,7 +125,7 @@ describe('measureUserJourneyStep', () => {
125125
);
126126
expect(analyticsTrackerSpy).toHaveBeenCalledTimes(1);
127127
expect(analyticsTrackerSpy).toHaveBeenCalledWith({
128-
attribution: { category: 'user_journey_step' },
128+
attribution: { category: 'step' },
129129
metricName: 'load_second_screen_first_journey',
130130
rating: 'good',
131131
data: 100,
@@ -182,7 +182,7 @@ describe('measureUserJourneyStep', () => {
182182
metricName: 'load_first_screen_first_journey',
183183
rating: 'good',
184184
data: 2000,
185-
attribution: { category: 'user_journey_step' },
185+
attribution: { category: 'step' },
186186
navigationType: undefined,
187187
navigatorInformation: {
188188
deviceMemory: 0,

Diff for: src/constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export const WP = W.performance;
77
export const getDM = () => (WN as any).deviceMemory;
88
export const getHC = () => (WN as any).hardwareConcurrency;
99
export const M = 'mark.'; // Mark Prefix
10+
export const S = 'step.'; // Step Prefix

Diff for: src/userJourney/getJourneyMarkName.ts

-1
This file was deleted.

Diff for: src/userJourney/getJourneyStepMetricName.ts

-2
This file was deleted.

Diff for: src/userJourney/measureJourneyStep.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { M, WP } from '../constants';
1+
import { M, S, WP } from '../constants';
22
import { reportPerf } from '../reportPerf';
33
import { config } from '../config';
44

5-
import { getJourneyStepMetricName } from './getJourneyStepMetricName';
65
import { USER_JOURNEY_THRESHOLDS } from '../vitalsScore';
76
import { getRating } from '../vitalsScore';
87
import { getJourneyStepVitalMetricName } from './getJourneyStepVitalMetricName';
@@ -12,8 +11,7 @@ export const measureJourneyStep = (
1211
startMark: string,
1312
endMark: string,
1413
) => {
15-
const journeyStepMetricName = getJourneyStepMetricName(step);
16-
14+
const journeyStepMetricName = S + step;
1715
const isLaunchJourney = startMark === 'launch';
1816
const startMarkExists = WP.getEntriesByName(M + startMark).length > 0;
1917
const endMarkExists = WP.getEntriesByName(M + endMark).length > 0;
@@ -37,7 +35,7 @@ export const measureJourneyStep = (
3735
step,
3836
journeyStepMeasure.duration,
3937
score,
40-
{ category: 'user_journey_step' },
38+
{ category: 'step' },
4139
undefined,
4240
);
4341
}
@@ -56,7 +54,7 @@ export const measureJourneyStep = (
5654
step,
5755
duration,
5856
score,
59-
{ category: 'user_journey_step' },
57+
{ category: 'step' },
6058
undefined,
6159
);
6260
const journeyStepVitalMetricName = getJourneyStepVitalMetricName(

0 commit comments

Comments
 (0)