Skip to content

Commit 633895c

Browse files
Merge branch 'main' into standard_reports
2 parents 044c9c7 + 1caf76d commit 633895c

30 files changed

Lines changed: 1944 additions & 146 deletions

definitions/declarations/chrome-ux-report.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,3 @@ FROM ${ctx.ref(database, 'materialized', 'device_summary')}
3030
|> WHERE cnt_devices != 3 OR cnt_ranks != 10
3131
|> SELECT "Table data doesn't match 3 unique devices and 10 ranks" AS error_message
3232
`)
33-
34-
declare({
35-
database,
36-
schema: 'experimental',
37-
name: 'global'
38-
})

definitions/declarations/httparchive.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,21 @@ ORDER BY cnt_pages DESC
4040
name: table
4141
})
4242
)
43+
44+
operate('create_reservation_assignment')
45+
.tags(['crawl_complete'])
46+
.queries(ctx => `
47+
CREATE ASSIGNMENT
48+
\`httparchive.region-us.retrospective-reprocessing.pipeline\`
49+
OPTIONS (
50+
assignee = 'projects/httparchive',
51+
job_type = 'QUERY')
52+
`)
53+
54+
operate('drop_reservation_assignment')
55+
.dependencies(['requests_10k'])
56+
.tags(['crawl_complete'])
57+
.queries(ctx => `
58+
DROP ASSIGNMENT IF EXISTS
59+
\`httparchive.region-us.retrospective-reprocessing.pipeline\`
60+
`)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
publish('technology_matrix', {
2+
type: 'table',
3+
schema: 'core_web_vitals',
4+
bigquery: {
5+
partitionBy: 'date',
6+
clusterBy: ['client', 't1']
7+
},
8+
description: 'Used in: https://lookerstudio.google.com/u/2/reporting/0ad64c8f-644a-40f9-93e4-0ccd5f72b33d',
9+
tags: ['crawl_complete']
10+
}).query(ctx => `
11+
WITH a AS (
12+
SELECT
13+
date,
14+
client,
15+
root_page,
16+
technology AS t1,
17+
ARRAY_TO_STRING(ARRAY(SELECT category FROM UNNEST(categories) AS category ORDER BY category), ', ') AS c1
18+
FROM ${ctx.ref('crawl', 'pages')},
19+
UNNEST(technologies)
20+
WHERE
21+
date = '${constants.currentMonth}' AND
22+
is_root_page
23+
), b AS (
24+
SELECT
25+
client,
26+
root_page,
27+
technology AS t2,
28+
ARRAY_TO_STRING(ARRAY(SELECT category FROM UNNEST(categories) AS category ORDER BY category), ', ') AS c2
29+
FROM ${ctx.ref('crawl', 'pages')},
30+
UNNEST(technologies)
31+
WHERE
32+
date = '${constants.currentMonth}' AND
33+
is_root_page
34+
)
35+
36+
37+
SELECT
38+
date,
39+
client,
40+
t1,
41+
c1,
42+
t2,
43+
c2,
44+
COUNT(DISTINCT root_page) AS pages
45+
FROM a
46+
LEFT JOIN b
47+
USING (client, root_page)
48+
GROUP BY
49+
date,
50+
client,
51+
t1,
52+
c1,
53+
t2,
54+
c2
55+
`)

definitions/output/crawl/pages.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ publish('pages', {
4747
technologies: 'Technologies detected at runtime (see https://www.wappalyzer.com/)',
4848
metadata: 'Additional metadata about the test'
4949
},
50-
tags: ['crawl_complete']
50+
tags: ['crawl_complete'],
51+
dependencies: ['create_reservation_assignment']
5152
}).preOps(ctx => `
5253
DELETE FROM ${ctx.self()}
5354
WHERE date = '${constants.currentMonth}' AND

definitions/output/crawl/parsed_css.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ publish('parsed_css', {
77
clusterBy: ['client', 'is_root_page', 'rank', 'page'],
88
requirePartitionFilter: true
99
},
10-
tags: ['crawl_complete']
10+
tags: ['crawl_complete'],
11+
dependencies: ['create_reservation_assignment']
1112
}).preOps(ctx => `
1213
DELETE FROM ${ctx.self()}
1314
WHERE date = '${constants.currentMonth}'

definitions/output/crawl/requests.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ publish('requests', {
3636
},
3737
response_body: 'Text-based response body'
3838
},
39-
tags: ['crawl_complete']
39+
tags: ['crawl_complete'],
40+
dependencies: ['create_reservation_assignment']
4041
}).preOps(ctx => `
4142
FOR client_value IN (SELECT * FROM UNNEST(['desktop', 'mobile']) AS client) DO
4243
FOR is_root_page_value IN (SELECT * FROM UNNEST([TRUE, FALSE]) AS is_root_page) DO

definitions/output/reports/cwv_tech_adoption.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish('cwv_tech_adoption', {
88
partitionBy: 'date',
99
clusterBy: ['rank', 'geo']
1010
},
11-
tags: ['crux_ready', 'tech_report']
11+
tags: ['crux_ready']
1212
}).preOps(ctx => `
1313
DELETE FROM ${ctx.self()}
1414
WHERE date = '${pastMonth}';

definitions/output/reports/cwv_tech_categories.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const pastMonth = constants.fnPastMonth(constants.currentMonth)
33
publish('cwv_tech_categories', {
44
schema: 'reports',
55
type: 'table',
6-
tags: ['crux_ready', 'tech_report']
6+
tags: ['crux_ready']
77
}).query(ctx => `
88
/* {"dataform_trigger": "report_cwv_tech_complete", "name": "categories", "type": "dict"} */
99
WITH pages AS (
@@ -55,6 +55,14 @@ technology_stats AS (
5555
GROUP BY
5656
technology,
5757
categories
58+
),
59+
60+
total_pages AS (
61+
SELECT
62+
client,
63+
COUNT(DISTINCT root_page) AS origins
64+
FROM pages
65+
GROUP BY client
5866
)
5967
6068
SELECT
@@ -82,11 +90,5 @@ SELECT
8290
COALESCE(MAX(IF(client = 'mobile', origins, 0))) AS mobile
8391
) AS origins,
8492
NULL AS technologies
85-
FROM (
86-
SELECT
87-
client,
88-
COUNT(DISTINCT root_page) AS origins
89-
FROM pages
90-
GROUP BY client
91-
)
93+
FROM total_pages
9294
`)

definitions/output/reports/cwv_tech_core_web_vitals.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish('cwv_tech_core_web_vitals', {
88
partitionBy: 'date',
99
clusterBy: ['rank', 'geo']
1010
},
11-
tags: ['crux_ready', 'tech_report']
11+
tags: ['tech_report']
1212
}).preOps(ctx => `
1313
CREATE TEMPORARY FUNCTION GET_VITALS(
1414
records ARRAY<STRUCT<

definitions/output/reports/cwv_tech_lighthouse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ publish('cwv_tech_lighthouse', {
88
partitionBy: 'date',
99
clusterBy: ['rank', 'geo']
1010
},
11-
tags: ['crux_ready', 'tech_report']
11+
tags: ['crux_ready']
1212
}).preOps(ctx => `
1313
CREATE TEMPORARY FUNCTION GET_LIGHTHOUSE(
1414
records ARRAY<STRUCT<

0 commit comments

Comments
 (0)