File tree 1 file changed +0
-32
lines changed
1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change @@ -172,38 +172,6 @@ export function scoreBundle(bundle) {
172
172
return 'poor' ;
173
173
}
174
174
175
- export const INTERPOLATION_THRESHOLD = 10 ;
176
-
177
- export function simpleCWVInterpolationFn ( metric , threshold ) {
178
- return ( cwvs ) => {
179
- const valuedWeights = Object . values ( cwvs )
180
- . filter ( ( value ) => value . weight !== undefined )
181
- . map ( ( value ) => value . weight )
182
- . reduce ( ( acc , value ) => acc + value , 0 ) ;
183
- return cwvs [ threshold + metric ] . weight / valuedWeights ;
184
- } ;
185
- }
186
- export function cwvInterpolationFn ( targetMetric ) {
187
- return ( cwvs ) => {
188
- const valueCount = cwvs . goodCWV . count + cwvs . niCWV . count + cwvs . poorCWV . count ;
189
- const valuedWeights = cwvs . goodCWV . weight + cwvs . niCWV . weight + cwvs . poorCWV . weight ;
190
-
191
- if ( valueCount < INTERPOLATION_THRESHOLD ) {
192
- // not enough data to interpolate
193
- return 0 ;
194
- }
195
- // total weight
196
- const totalWeight = cwvs . goodCWV . weight
197
- + cwvs . niCWV . weight
198
- + cwvs . poorCWV . weight
199
- + cwvs . noCWV . weight ;
200
- // share of targetMetric compared to all CWV
201
- const share = cwvs [ targetMetric ] . weight / ( valuedWeights ) ;
202
- // interpolate the share to the total weight
203
- return Math . round ( share * totalWeight ) ;
204
- } ;
205
- }
206
-
207
175
/**
208
176
* Conversion rates are computed as the ratio of conversions to visits. The conversion rate is
209
177
* capped at 100%.
You can’t perform that action at this time.
0 commit comments