query on bigquery

119 views
Skip to first unread message

Gabriely Xavier

unread,
Aug 1, 2022, 1:40:53 PM8/1/22
to Chrome UX Report (Discussions)
Hello,

I see that in the materialized > metrics_query on bigquery the limits of each metric are defined differently from the web vitals documentation.
for example:
in the query:
Captura de Tela 2022-08-01 às 14.20.30.png

and in the documentation
Captura de Tela 2022-08-01 às 14.22.45.png
https://web.dev/defining-core-web-vitals-thresholds/

small < 0.1 or small <=0.1
large >= 0.25 or large  > 0.25
....
??


ie, the limits are different for all metrics, what would be the correct limit to consider?


Thanks in advance!

Rick Viscomi

unread,
Aug 1, 2022, 1:52:02 PM8/1/22
to Gabriely Xavier, Chrome UX Report (Discussions)
The histogram bins in BigQuery are inclusive of the start value and exclusive of the end value, or [start, end). So `start <= 0.1` in CrUX BQ would actually include everything in the bin having start=0.1, end=0.15, which is more than we want.

To be more consistent with the documentation one could also write the queries as `end <= 0.1`. Would it be helpful if we rewrote our queries to consistently use the `end <= 0.1` convention?

--
You received this message because you are subscribed to the Google Groups "Chrome UX Report (Discussions)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chrome-ux-repo...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chrome-ux-report/741a05e2-05e5-4f1e-b92a-b75e1875aa77n%40chromium.org.

Gabriely Xavier

unread,
Aug 2, 2022, 9:27:53 AM8/2/22
to Chrome UX Report (Discussions), rvis...@google.com, Chrome UX Report (Discussions), Gabriely Xavier


Hi!! 
thanks for the explanations

but taking this same example, 
as the histogram bins considers the range like this [start, end), if end<=0.1 or start<0.1, ie [0,0.1),  still exclude the 0.1 from the small range and include it in the medium range.

I see that the way to get this right would be to change the limits of the histogram bins, ie (start, end], and then start<0.1 or end<=0.1 would be including 0.1 in the small range, as the documentation says.

for example, if   histogram bins := (start, end]
small: start<0.1 or end <=0.1 :=  (0, 0.1] (0.1 belongs to the small level)
medium: start>=0.1 and start <0.25 (0.1, 0.25]
slow: start>=0.25 or end>0.25 := (0.25, inf] (0.25 does not belong to the slow level)

it makes sense?

or maybe change the documentation to be small<0.1 and slow >=0.25

Rick Viscomi

unread,
Aug 2, 2022, 4:35:39 PM8/2/22
to Gabriely Xavier, Chrome UX Report (Discussions)
but taking this same example, 
as the histogram bins considers the range like this [start, end), if end<=0.1 or start<0.1, ie [0,0.1),  still exclude the 0.1 from the small range and include it in the medium range.

I see that the way to get this right would be to change the limits of the histogram bins, ie (start, end], and then start<0.1 or end<=0.1 would be including 0.1 in the small range, as the documentation says.

You're absolutely right. Scores of exactly 0.1 will always fall into a bin of values consisting of larger scores. That said, it only affects scores that are exactly 0.1000; a score of 0.0999 will be correctly included in bins having start<0.1.

Changing the bins to be (start, end] would be a good solution, but unfortunately the underlying dataset isn't structured that way. Given that it's an implementation detail of the CrUX histograms on BigQuery and not very likely to make or break anyone's CWV score, I think the next best option is to use end<=0.1 notation across our tools and documentation, to avoid any confusion if possible.

Gabriely Xavier

unread,
Aug 2, 2022, 6:44:53 PM8/2/22
to Chrome UX Report (Discussions), rvis...@google.com, Chrome UX Report (Discussions), Gabriely Xavier

Yes, it makes sense!

Thanks again for the explanations.
Reply all
Reply to author
Forward
0 new messages