-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transfer to v3 #1024
Open
MarquiseRosier
wants to merge
13
commits into
main
Choose a base branch
from
transfer-to-v3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Transfer to v3 #1024
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b04f75f
migrate to v3
233ff33
add to package.json
9ff3592
add github-commits
0efa566
rum-dashboard supports exact match
8d1d258
fix grouping
91ec5f7
coalesce views and topurls
0bcec7f
tiny syntax error
fd90f99
rum-dashboard-exact-match
7c08b0e
update rum-pageviews to use EVENTS_V4
902b16f
remove unused from package.json
003a28b
feat: update dashboard queries
9facfcc
no need for rum-sources-aggregate
c39dc76
update static list
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- description: Get Daily Commits For a Site or Repo | ||
--- Authorization: none | ||
--- Access-Control-Allow-Origin: * | ||
--- limit: 30 | ||
--- interval: 30 | ||
--- offset: 0 | ||
--- startdate: 2023-02-01 | ||
--- enddate: 2023-05-28 | ||
--- timezone: UTC | ||
--- timeunit: day | ||
--- exactmatch: false | ||
--- url: - | ||
--- device: all | ||
--- domainkey: secret | ||
WITH current_data AS ( | ||
SELECT * | ||
FROM | ||
`HELIX-225321.HELIX_EXTERNAL_DATA.DAILY_COMMITS`( | ||
@url, | ||
@offset, | ||
@interval, | ||
@startdate, | ||
@enddate, | ||
@domainkey | ||
) | ||
) | ||
|
||
SELECT * FROM current_data WHERE | ||
NOT user = 'GitHub' | ||
AND NOT user = 'GitHub Action' | ||
AND NOT user = 'GitHub Enterprise' | ||
AND NOT user = 'CircleCi Build' | ||
AND NOT user = 'Helix Bot' | ||
AND NOT user = 'adobe-alloy-bot' | ||
AND NOT user = 'github-actions' | ||
AND NOT user = 'github-actions[bot]' | ||
AND NOT user = 'helix-bot[bot]' | ||
AND NOT user = 'renovate[bot]' | ||
AND NOT user = 'semantic-release-bot' | ||
ORDER BY owner_repo ASC, commit_date ASC |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- description: Get Helix RUM data for a given domain or owner/repo combination | ||
--- Authorization: none | ||
--- Access-Control-Allow-Origin: * | ||
--- limit: 10 | ||
--- interval: 30 | ||
--- offset: 0 | ||
--- startdate: 2022-02-01 | ||
--- enddate: 2022-05-28 | ||
--- timezone: UTC | ||
--- url: - | ||
--- device: all | ||
--- domainkey: secret | ||
WITH pageviews_by_id AS ( | ||
SELECT | ||
hostname, | ||
id, | ||
MAX(weight) AS pageviews | ||
FROM | ||
`helix-225321.helix_rum.EVENTS_V4`( | ||
net.host(@url), @offset, @interval, '-', '-', 'UTC', 'all', @domainkey | ||
) | ||
GROUP BY id, hostname | ||
) | ||
|
||
SELECT | ||
hostname, | ||
SUM(pageviews) AS pageviews | ||
FROM pageviews_by_id | ||
GROUP BY hostname | ||
ORDER BY pageviews DESC |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
--- timezone: UTC | ||
--- domainkey: secret | ||
DECLARE results NUMERIC; | ||
CREATE OR REPLACE PROCEDURE helix_rum.UPDATE_PAGEVIEWS( | ||
ingranularity INT64, | ||
inlimit INT64, | ||
inoffset INT64, | ||
|
@@ -18,11 +18,11 @@ | |
OUT results NUMERIC | ||
) | ||
BEGIN | ||
CREATE TEMP TABLE temp_pageviews( | ||
year INT64, | ||
month INT64, | ||
day INT64, | ||
time STRING, | ||
url INT64, | ||
pageviews NUMERIC | ||
) | ||
|
@@ -37,7 +37,7 @@ | |
WHEN 365 THEN TIMESTAMP_TRUNC(time, YEAR) | ||
ELSE TIMESTAMP_TRUNC(time, DAY) | ||
END AS date | ||
FROM helix_rum.PAGEVIEWS_V3( | ||
FROM helix_rum.PAGEVIEWS_V4( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not create |
||
inurl, # url | ||
(inoffset * ingranularity) - 1, # offset | ||
inlimit * ingranularity, # days to fetch | ||
|
@@ -64,7 +64,7 @@ | |
EXTRACT(YEAR FROM date) AS year, | ||
EXTRACT(MONTH FROM date) AS month, | ||
EXTRACT(DAY FROM date) AS day, | ||
STRING(date) AS time, | ||
COUNT(url) AS urls, | ||
SUM(weight) AS pageviews | ||
FROM pageviews_by_id | ||
|
@@ -91,7 +91,7 @@ | |
WHEN 90 THEN TIMESTAMP_TRUNC(alldates, QUARTER) | ||
WHEN 365 THEN TIMESTAMP_TRUNC(alldates, YEAR) | ||
ELSE TIMESTAMP_TRUNC(alldates, DAY) | ||
END AS alldates FROM basicdates | ||
GROUP BY alldates | ||
), | ||
|
||
|
@@ -100,7 +100,7 @@ | |
EXTRACT(YEAR FROM dates.alldates) AS year, | ||
EXTRACT(MONTH FROM dates.alldates) AS month, | ||
EXTRACT(DAY FROM dates.alldates) AS day, | ||
STRING(dates.alldates) AS time, | ||
COALESCE(dailydata.urls, 0) AS distinct_urls, | ||
COALESCE(dailydata.pageviews, 0) AS pageviews | ||
FROM dates | ||
|
@@ -112,7 +112,7 @@ | |
SELECT * FROM finaldata ORDER BY time DESC; | ||
SET results = (SELECT SUM(pageviews) FROM (SELECT * FROM temp_pageviews)); | ||
END; | ||
IF (CAST(@granularity AS STRING) = "auto") THEN | ||
Check failure on line 115 in src/queries/rum-pageviews.sql GitHub Actions / SQLFluff LintSQLFluff
|
||
CALL helix_rum.UPDATE_PAGEVIEWS(1, CAST(@interval AS INT64), CAST(@offset AS INT64), @url, @timezone, @domainkey, results); | ||
IF (results > (CAST(@interval AS INT64) * 200)) THEN | ||
# we have enough results, use the daily granularity | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@url
should have the same semantics as the rest of the@url
parameters, so URL prefix withouthttps://
, optional path and$
or?
delimiters.startdate
andenddate
in the supported parameters, you should also pass them through heretimezone
device
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the same data should come from
PAGEVIEWS_V4
– why does this query exist whenrum-pageviews
is there already?