OrangeFactor spends a lot of time calling json-pushes for each request

RESOLVED FIXED

Status

Tree Management
OrangeFactor
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
1) It doesn't make use of &tipsonly=1 (which means the json-pushes response only describes the topmost changeset for each push, rather than all of them). (We don't need the rest).
2) The UI hits the API multiple times during pageload (eugh), and each time we query the pushlog, eg:

http://hg.mozilla.org/mozilla-central/json-pushes?startdate=2015-08-31&enddate=2015-09-08
http://hg.mozilla.org/integration/mozilla-inbound/json-pushes?startdate=2015-08-31&enddate=2015-09-08
http://hg.mozilla.org/integration/b2g-inbound/json-pushes?startdate=2015-08-31&enddate=2015-09-08
http://hg.mozilla.org/integration/fx-team/json-pushes?startdate=2015-08-31&enddate=2015-09-08
127.0.0.1:51358 - - [07/Sep/2015 12:08:29] "HTTP/1.1 GET /api/count" - 200 OK
http://hg.mozilla.org/mozilla-central/json-pushes?startdate=2015-08-31&enddate=2015-09-08
http://hg.mozilla.org/integration/mozilla-inbound/json-pushes?startdate=2015-08-31&enddate=2015-09-08
http://hg.mozilla.org/integration/b2g-inbound/json-pushes?startdate=2015-08-31&enddate=2015-09-08
http://hg.mozilla.org/integration/fx-team/json-pushes?startdate=2015-08-31&enddate=2015-09-08
127.0.0.1:51363 - - [07/Sep/2015 12:08:37] "HTTP/1.1 GET /api/bybug" - 200 OK

It's probably not worth trying to fix #2 (either by refactoring the UI/API so we don't need two calls, or by using the requests-cache or CacheControl packages), but let's do #1.
(Assignee)

Comment 1

2 years ago
Created attachment 8657845 [details] [diff] [review]
Pass `tipsonly=1` to the json-pushes query to speed it up

Since we're only calculating the number of pushes for each date, so don't need the list of changesets within each push.

See:
http://mozilla-version-control-tools.readthedocs.org/en/latest/hgmo/pushlog.html#query-parameters
Attachment #8657845 - Flags: review?(jgriffin)
(Assignee)

Comment 2

2 years ago
Testing locally and from brasstacks, this reduced the json-pushes total request time by 30-50%.
Comment on attachment 8657845 [details] [diff] [review]
Pass `tipsonly=1` to the json-pushes query to speed it up

Review of attachment 8657845 [details] [diff] [review]:
-----------------------------------------------------------------

Nice, I didn't know about tipsonly
Attachment #8657845 - Flags: review?(jgriffin) → review+
(Assignee)

Comment 4

2 years ago
remote:   https://hg.mozilla.org/automation/orangefactor/rev/150588bdfc50
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.