Merge pull request #194 from mozilla/make-sure-to-update-yesterday-value

Calculate the value of yesterday in the telemetry side.
This commit is contained in:
Rémy HUBSCHER 2018-02-14 15:34:05 +01:00 коммит произвёл GitHub
Родитель 04a660c89f 0621b2b1af
Коммит 4f831d2669
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -1,10 +1,10 @@
CHANGELOG
=========
1.2.0 (unreleased)
1.1.1 (unreleased)
------------------
- Nothing changed yet.
- Improve the Telemetry query to always update the yesterday filter. (#193)
1.1.0 (2018-02-14)

Просмотреть файл

@ -98,7 +98,7 @@ async def main_summary_uptake(product, version):
WITH updated_t AS (
SELECT COUNT(DISTINCT client_id)*100 AS updated
FROM main_summary
WHERE submission_date_s3 >= '{submission_date}'
WHERE submission_date_s3 >= date_format(current_date - interval '1' day, '%Y%m%d')
AND app_build_id IN ({build_ids})
AND normalized_channel = '{channel}'
AND sample_id = '{sample_id}'
@ -106,14 +106,13 @@ async def main_summary_uptake(product, version):
total_t AS (
SELECT COUNT(DISTINCT client_id)*100 AS total
FROM main_summary
WHERE submission_date_s3 >= '{submission_date}'
WHERE submission_date_s3 >= date_format(current_date - interval '1' day, '%Y%m%d')
AND normalized_channel = '{channel}'
AND sample_id = '{sample_id}'
)
SELECT updated * 1.0 / total as ratio, updated, total
FROM updated_t, total_t
""".format(build_ids=', '.join(["'{}'".format(bid) for bid in build_ids]),
submission_date=submission_date,
channel=channel.value.lower(),
sample_id=TELEMETRY_CACHED_SAMPLE)