-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(insights): Removes unused webvitals function query and code (#82485
) The frontend doesn't actually use the `weighted_performance_score` function anymore. Removes all calls and references from frontend code.
- Loading branch information
1 parent
16d4d44
commit be0f4da
Showing
5 changed files
with
19 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 4 additions & 11 deletions
15
static/app/views/insights/browser/webVitals/utils/applyStaticWeightsToTimeseries.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
import type { | ||
UnweightedWebVitalsScoreBreakdown, | ||
WebVitalsScoreBreakdown, | ||
} from 'sentry/views/insights/browser/webVitals/queries/storedScoreQueries/useProjectWebVitalsScoresTimeseriesQuery'; | ||
import type {WebVitalsScoreBreakdown} from 'sentry/views/insights/browser/webVitals/queries/storedScoreQueries/useProjectWebVitalsScoresTimeseriesQuery'; | ||
import {PERFORMANCE_SCORE_WEIGHTS} from 'sentry/views/insights/browser/webVitals/utils/scoreThresholds'; | ||
|
||
// Returns a weighed score timeseries with each interval calculated from applying hardcoded weights to unweighted scores | ||
export function applyStaticWeightsToTimeseries( | ||
timeseriesData: WebVitalsScoreBreakdown & UnweightedWebVitalsScoreBreakdown | ||
) { | ||
export function applyStaticWeightsToTimeseries(timeseriesData: WebVitalsScoreBreakdown) { | ||
return { | ||
...Object.keys(PERFORMANCE_SCORE_WEIGHTS).reduce((acc, webVital) => { | ||
acc[webVital] = timeseriesData[ | ||
`unweighted${webVital.charAt(0).toUpperCase()}${webVital.slice(1)}` | ||
].map(({name, value}) => ({ | ||
acc[webVital] = timeseriesData[webVital].map(({name, value}) => ({ | ||
name, | ||
value: value * PERFORMANCE_SCORE_WEIGHTS[webVital] * 0.01, | ||
})); | ||
return acc; | ||
}, {}), | ||
total: timeseriesData.total, | ||
} as WebVitalsScoreBreakdown & UnweightedWebVitalsScoreBreakdown; | ||
} as WebVitalsScoreBreakdown; | ||
} |