Skip to content

Commit 00fae36

Browse files
committed
fix month
1 parent 95bca5b commit 00fae36

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

definitions/output/reports/cwv_tech_categories.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,3 @@ FROM total_pages
104104
}'''
105105
);
106106
`)
107-

definitions/output/reports/reports_dynamic.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const metrics = configs.listMetrics()
44
const bucket = 'httparchive'
55
const storagePath = '/reports/'
66

7-
function generateExportQuery(metric, sql, params, ctx) {
7+
function generateExportQuery (metric, sql, params, ctx) {
88
if (sql.type === 'histogram') {
99
return `
1010
SELECT
@@ -18,12 +18,13 @@ SELECT
1818
FORMAT_DATE('%Y_%m_%d', date) AS date,
1919
* EXCEPT(date)
2020
FROM reports.${metric}_timeseries
21-
`} else {
21+
`
22+
} else {
2223
throw new Error('Unknown SQL type')
2324
}
2425
}
2526

26-
function generateExportPath(metric, sql, params) {
27+
function generateExportPath (metric, sql, params) {
2728
if (sql.type === 'histogram') {
2829
return `${storagePath}${params.date.replaceAll('-', '_')}/${metric}.json`
2930
} else if (sql.type === 'timeseries') {
@@ -35,9 +36,9 @@ function generateExportPath(metric, sql, params) {
3536

3637
const iterations = []
3738
for (
38-
let date = constants.currentMonth; month >= constants.currentMonth; month = constants.fnPastMonth(month)) {
39+
let date = constants.currentMonth; date >= constants.currentMonth; date = constants.fnPastMonth(date)) {
3940
iterations.push({
40-
date: date
41+
date
4142
})
4243
}
4344

@@ -49,8 +50,8 @@ if (iterations.length === 1) {
4950
type: 'incremental',
5051
protected: true,
5152
bigquery: sql.type === 'histogram' ? { partitionBy: 'date', clusterBy: ['client'] } : {},
52-
schema: 'reports',
53-
//tags: ['crawl_complete', 'http_reports']
53+
schema: 'reports'
54+
// tags: ['crawl_complete', 'http_reports']
5455
}).preOps(ctx => `
5556
--DELETE FROM ${ctx.self()}
5657
--WHERE date = '${params.date}';
@@ -76,7 +77,7 @@ SELECT
7677
metrics.forEach(metric => {
7778
metric.SQL.forEach(sql => {
7879
operate(metric.id + '_' + sql.type + '_' + params.date, {
79-
//tags: ['crawl_complete']
80+
// tags: ['crawl_complete']
8081
}).queries(ctx => `
8182
DELETE FROM reports.${metric.id}_${sql.type}
8283
WHERE date = '${params.date}';

0 commit comments

Comments
 (0)