Page MenuHomePhabricator

Geo Analytics: Remove indentation from response (minify response)
Closed, ResolvedPublic1 Estimated Story Points

Description

Epic: T288305: AQS 2.0: Geo Analytics Service

Description

All 2.0 services responded with an indented response body but traffic team warned us about that because responses were bigger than before (66% bigger in some cases). That's why we decided to remove indentation from responses for all services. Because some of them were already deployed, this work is still pending for geo-analytics

Acceptance Criteria

  • Indentation has been removed for any response (including healthz endpoint)

Required

  • Run unit and integration tests after removing indentation

Event Timeline

Sfaci triaged this task as Medium priority.Oct 3 2023, 2:05 PM
WDoranWMF set the point value for this task to 1.Oct 17 2023, 11:09 AM

Change 976693 had a related patch set uploaded (by Jennifer Ebe; author: Jennifer Ebe):

[generated-data-platform/aqs/geo-analytics@main] Geo Analytics: Remove indentation from response (minify response)

https://gerrit.wikimedia.org/r/976693

Change 976693 merged by Sg912:

[generated-data-platform/aqs/geo-analytics@main] Geo Analytics: Remove indentation from response (minify response)

https://gerrit.wikimedia.org/r/976693

Test status: QA PASS

After pulling the lastest changes and running locally for device analytics, tests run as expected on the assignef port 8090

import requests


base_url = "http://localhost:8090/metrics/unique-devices/en.wikipedia/all-sites/daily/20180101/20180105"

header = {"accept": "application/json",
          "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"}

response = requests.get(base_url, headers=header)


print(f"The response status code is: {response.status_code}")
print(response.json())

Screenshot 2023-12-04 at 10.36.39 PM.png (939×1 px, 198 KB)