Closed Bug 1202385 Opened 9 years ago Closed 9 years ago

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

Categories

(Tree Management Graveyard :: OrangeFactor, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

Details

Attachments

(1 file)

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.
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)
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+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Tree Management → Tree Management Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: