Re: Reasons API requests would be taking longer after RB upgrade?

2013-04-11 Thread Ethan Lowry
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= 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  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 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/**donate/<http://www.reviewboard.org/donate/>
>>>>> Happy user? Let us know at 
>>&

Re: Reasons API requests would be taking longer after RB upgrade?

2013-04-11 Thread Ethan Lowry
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= 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 
> > 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  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/**donate/<http://www.reviewboard.org/donate/>
>>>> Happy user? Let us know at 
>>>> http://www.reviewboard.org/**users/<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/**groups/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.




Re: Reasons API requests would be taking longer after RB upgrade?

2013-04-10 Thread Ethan Lowry
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 
> > 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/donate/
>> Happy user? Let us know at 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
>> --- 
>> 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/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.




Reasons API requests would be taking longer after RB upgrade?

2013-04-10 Thread Ethan Lowry
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/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.




RB Authentication not working with Ruby's Open URI

2013-03-28 Thread Ethan Lowry
Hi, 

I've been trying out Ruby and Open URI with ReviewBoard's API and it seems 
to work fine with url's that don't require authentication, but any that do 
(eg. 
"http://machinename/reviewboard/api/review-requests?time-added-from=whatever"; 
- this only seems to need auth when request parameters are added, is this 
correct?) are failing with the following error:

C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:346:in 
`open_http2013-03-21
': 401 UNAUTHORIZED (OpenURI::HTTPError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:775:in 
`buffer_open'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:203:in `block 
in open_loop'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:201:in `catch'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:201:in 
`open_loop'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:146:in 
`open_uri'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:677:in `open'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/open-uri.rb:33:in `open'
from C:/Users/me/Documents/reviewboard.rb:30:in `'
[Finished in 2.5s with exit code 1]

And my request looks like:

results = 
> JSON.parse(open("http://machinename/reviewboard/api/review-requests?time-added-from=whatever";,
>  
> :http_basic_authentication=>[user,pass],"Accept"=>'application/json') {|io| 
> io.read})


For whatever reason the authentication is just being ignored. Ruby does not 
seem to have any support for the "username:password@URL" format of auth 
either. 

Anyone have any experience with this?

Thanks,
E

-- 
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.




Re: Review Board reports?

2013-03-28 Thread Ethan Lowry
Hi David,

To quote some of the example metrics my manager gave:

*"*
   
   - *Number of review requests created*
   - *Number of review requests completed (Ship It)*
   - *Number of review requests outstanding*
   - *People most/least active in code reviewing."
   
   *

I guess in the meantime I'll see if I can make something happen using the 
API with a ruby app or something.

On Tuesday, 26 March 2013 19:27:42 UTC, David Trowbridge wrote:
>
> Ethan,
>
> We currently don't have this functionality, but I've been starting to 
> think about this. It's likely that we'd do such a thing as a commercially 
> licensed extension (in order to help fund the project). What specific 
> metrics would your manager like to track?
>
>
> On Tue, Mar 26, 2013 at 8:42 AM, Ethan Lowry 
> > wrote:
>
>> Hi all,
>>
>> My manager has asked about generating reports from our Review Board so we 
>> can see certain information every week or so - things like how many review 
>> requests actually get reviewed, by who, and so on.
>>
>> I've tried searching for an existing solution to do something like this 
>> but haven't found anything so far. Does anyone know of any options, or 
>> might we have to make something ourselves? And if so, any pointers?
>>
>> Thanks,
>> Ethan
>>
>> -- 
>> 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...@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...@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.




Review Board reports?

2013-03-26 Thread Ethan Lowry
Hi all,

My manager has asked about generating reports from our Review Board so we 
can see certain information every week or so - things like how many review 
requests actually get reviewed, by who, and so on.

I've tried searching for an existing solution to do something like this but 
haven't found anything so far. Does anyone know of any options, or might we 
have to make something ourselves? And if so, any pointers?

Thanks,
Ethan

-- 
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.