Page MenuHomePhabricator

Refactor Page Analytics according to the new AQSAssist
Open, Needs TriagePublic

Description

Goal

Extract to aqsassist some repeated and common code that is present in all the services and refactor them to avoid code duplication as we already did with the functions we created to validate the parameters in the handlers.

About the Druid common code refactoring we will take the following into consideration:

The way to parameterize Druid queries that was implemented in AQS 1.0 (https://github.com/wikimedia/analytics-aqs/blob/master/sys/mediawiki-history-schemas.yaml) to parametrize Druid queries using a separate file
We'll start refactoring editor-analytics because its code is already done and we'll have the opportunity of using its unit and integration tests to test the refactored service.

Tasks

  • Refactor
  • QA test
  • Deploy

Event Timeline

The changes here have been merged to prod. This has been tested through regression run for Page analytics and no issues found. All tests passed

Initially this was thought to be merged in production, hence wrongly tested. This is merged in the QA env and has been tested.

PROD url to test QA env with, top : "https://wikimedia.org/api/rest_v1/metrics/pageviews/top/en.wikipedia/all-access/2020/02/22"

PROD url to test QA env with, top-by-country : "https://wikimedia.org/api/rest_v1/metrics/pageviews/top-by-country/en.wikipedia.org/all-access/2020/01"

PROD url to test QA env with, aggregate : "https://wikimedia.org/api/rest_v1/metrics/pageviews/aggregate/en.wikipedia.org/all-access/all-agents/daily/2020011201/2020011518"

Local env version, top: "http://localhost:8093/metrics/pageviews/top/en.wikipedia/all-access/2020/02/22"

Local env version, top-by-country: "http://localhost:8093/metrics/pageviews/top-by-country/en.wikipedia.org/all-access/2020/01"

Local env version, aggregate: "http://localhost:8093/metrics/pageviews/aggregate/en.wikipedia.org/all-access/all-agents/daily/2020011201/2020011518"

data from prod and local were semantically identical.

No regression issues and ready for deployment.