That's definitely a lot of API calls, and I could see that being slow.

Yes, the ?expand= gets tacked onto the URL. So, when fetching the list of
review requests, you'd do:

    @review_requests.GET(accept: :json,params:{"time-added-
from"=>days_ago,"start"=>start,"max-results"=>per_page, "expand"=>"reviews"}
)

There could be other factors causing problems for you. Check the server
logs to see if your calls are being redirected, for example. Make sure a
trailing '/' is being added onto the URL. If you're using HTTPS, make sure
you have the 'HTTPS' environment variable set to 'on' in the Apache config
so it doesn't have to redirect.

Christian


-- 
Christian Hammond - chip...@chipx86.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com


On Thu, Apr 11, 2013 at 4:54 AM, Ethan Lowry <ethanma...@gmail.com> wrote:

> P.S. Oh, and thanks for the suggestion but just so I'm clear - is this
> expand? thing a parameter I should be adding to the URLs for my requests?
>
>
> On Thursday, 11 April 2013 12:52:50 UTC+1, Ethan Lowry wrote:
>>
>> Ok it'll probably be messy and my understanding of this stuff is
>> piecemeal but I'll try and lay out what's happening in terms of api calls:
>>
>> @review_requests.GET(accept: :json,params:{"time-added-**
>> from"=>days_ago,"start"=>**start,"max-results"=>per_page}**)
>>
>> ...That's run several times in iteration to get an array of results pages
>> containing review requests json. Note @review_requests resorce is simply
>> @root['review-requests]' . Then the following is done for each results page:
>>
>> GET review list for every request on the page
>> : request['links']['reviews'][**'href'].GET(accept: :json))['reviews']
>>
>> ...and that's actually it I think, everything else is just dealing with
>> the JSON once it's been retrieved and I don't see how that could've
>> randomly slowed way down from one day to the next.
>>
>> I can't imagine there's much to take from that sadly.
>>
>> On Thursday, 11 April 2013 08:06:37 UTC+1, Christian Hammond wrote:
>>>
>>> Can you show me the exact calls you're making?
>>>
>>> One thing that may help is to use ?expand=<fieldname> in your calls. You
>>> can retrieve sub-resources a bit this way. For example, retrieving review
>>> requests with ?expand=reviews.
>>>
>>> Christian
>>>
>>> --
>>> Christian Hammond - chi...@chipx86.com
>>> Review Board - http://www.reviewboard.org
>>> Beanbag, Inc. - http://www.beanbaginc.com
>>>
>>>
>>> On Wed, Apr 10, 2013 at 3:32 AM, Ethan Lowry <ethan...@gmail.com> wrote:
>>>
>>>> Hey Christian,
>>>>
>>>> The section of code taking so long does the following:
>>>>
>>>>
>>>>    - Recieves a page of json results from an earlier request
>>>>    retrieving review requests
>>>>    - For each individual review request, I'm checking if / how often
>>>>    it's been reviewed so each time I create a new Resource from
>>>>    'request['links']['reviews']['**href']' and do a .get request on
>>>>    that to count the number of results.
>>>>
>>>> I'm pretty sure those are the only calls to the server made throughout
>>>> the section that is taking forever.
>>>>
>>>> For the record I'm using ruby and the Rest 
>>>> Client<https://github.com/rest-client/rest-client> gem.
>>>> In looking through it again I did spot a potential area for better
>>>> efficiency so I'll try that in the meantime, any thoughts appreciated
>>>> though.
>>>>
>>>> Thanks
>>>>
>>>> On Wednesday, 10 April 2013 11:10:48 UTC+1, Christian Hammond wrote:
>>>>
>>>>> Hi Ethan,
>>>>>
>>>>> I can't think of a reason it would be slower since 1.6. It certainly
>>>>> doesn't appear to be slower for anything I've done in 1.7 (and the web UI
>>>>> uses the API for most of its operations as well).
>>>>>
>>>>> What calls are you making?
>>>>>
>>>>> Christian
>>>>>
>>>>> --
>>>>> Christian Hammond - chi...@chipx86.com
>>>>>
>>>>> Review Board - http://www.reviewboard.org
>>>>> Beanbag, Inc. - http://www.beanbaginc.com
>>>>>
>>>>>
>>>>> On Wed, Apr 10, 2013 at 3:07 AM, Ethan Lowry <ethan...@gmail.com>wrote:
>>>>>
>>>>>>  Hey,
>>>>>>
>>>>>> So I have a ruby script used for grabbing information on RB requests
>>>>>> etc from our Review Board. It was pretty slow at the best of times but
>>>>>> since we upgraded to the latest version of RB yesterday from 1.6 the time
>>>>>> it takes the script to run has been multiplied by about 5 =/
>>>>>>
>>>>>> I can give more details on the specific requests being made if needed
>>>>>> but does anyone off the top of their head know of any changes to the API 
>>>>>> or
>>>>>> anything since 1.6 that might be causing this?
>>>>>>
>>>>>> Thanks
>>>>>> E
>>>>>>
>>>>>> --
>>>>>> Want to help the Review Board project? Donate today at
>>>>>> http://www.reviewboard.org/**don**ate/<http://www.reviewboard.org/donate/>
>>>>>> Happy user? Let us know at 
>>>>>> http://www.reviewboard.org/**use**rs/<http://www.reviewboard.org/users/>
>>>>>> -~----------~----~----~----~--****----~----~------~--~---
>>>>>> To unsubscribe from this group, send email to reviewboard...@**
>>>>>> googlegroups.**com
>>>>>>
>>>>>> For more options, visit this group at http://groups.google.com/**
>>>>>> group**/reviewboard?hl=en<http://groups.google.com/group/reviewboard?hl=en>
>>>>>> ---
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "reviewboard" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to reviewboard...@**googlegroups.**com.
>>>>>>
>>>>>> For more options, visit 
>>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>>> .
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>  --
> Want to help the Review Board project? Donate today at
> http://www.reviewboard.org/donate/
> Happy user? Let us know at http://www.reviewboard.org/users/
> -~----------~----~----~----~------~----~------~--~---
> To unsubscribe from this group, send email to
> reviewboard+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/reviewboard?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to