[OpenStack-Infra] getting some advanced stats out of gerrit reviews

Clark Boylan cboylan at sapwetik.org
Mon Jun 24 17:00:34 UTC 2019


On Thu, Jun 20, 2019, at 2:15 AM, Sorin Sbarnea wrote:
> I would like to build some stats related to openstack gerrit reviews 
> and I would like to know few things:
> * how can I get a dump of the reviews with all comments?  (queries on 
> live DB are not an option)

You can query for the list of changes using https://review.opendev.org/Documentation/rest-api-changes.html#list-changes. The query can include a start and stop date too. Then iterate over that list of changes and get their comments with https://review.opendev.org/Documentation/rest-api-changes.html#list-change-comments.

> * did anyone already invested time in this direction? (happy to team-up 
> instead of having a DIY)

I believe ttx has done similar work to find different stats in the past. I want to say one of the big take aways from that was to not query all changes every time. You want to run periodically then query only the changes that have updated since your last run.

> 
> One graph I do want to build is would be with average number of 
> rechecks done on reviews before they are merged, per month. As you can 
> see that is not a trivial query to do but is doable.
> 
> Another metric it would be fun to build is the estimated failure-rate 
> for a single CR. As I can compute an average failure rase for each job, 
> it should not be hard to compute an estimate failure rate when I have a 
> the list of jobs triggered for specific change. That second one may not 
> be very practical but I am really curious what kind of values I would 
> endup with (obvious the range would vary a lot between projects).

You may be able to approximate this simply by checking graphite for failure rates on jobs then assume failures are independent (this assumption likely untrue but probably good enough for a start) then calculate the aggregate chance of failures for those jobs.

> 
> Thanks
> Sorin



More information about the OpenStack-Infra mailing list