[openstack-dev] [Metrics] Keeping up with review requests

Russell Bryant rbryant at redhat.com
Wed May 29 17:01:18 UTC 2013


On 05/29/2013 08:17 AM, Christopher Yeoh wrote:
> 
> On Wed, May 29, 2013 at 6:33 AM, Russell Bryant <rbryant at redhat.com
> <mailto:rbryant at redhat.com>> wrote:
> 
>     However, I couldn't resist scratching my own itch, so at least for now I
>     scripted this.  It's openreviews.py here:
> 
>         https://github.com/russellb/openstack-stats
> 
> 
> I had a bit of play around with the code and added displaying the median
> waiting time
> and 5 longest waiting reviews (I've sent a pull request)

Changes much appreciated.  :-)

> There probably should be an option to exclude WIPs but that data doesn't
> come back through
> the gerrit query.

Actually, it's there.  the change['status'] is 'NEW' vs
'WORKINPROGRESS'.  I updated it to filter out WIP reviews.

> There does appear to be a problem with some of the data returned from
> the gerrit query now however. For example,
> looking at  https://review.openstack.org/29005 sometimes the createdOn
> data for a patchset is just plain wrong and
> reverts to the original creation date which makes it look like the it
> hasn't been reviewed for a long time when it has.
> I had a look at the origin json data returned from the query and it is
> incorrect so I guess there's a gerrit query bug.
> 

Ah, I see what's happening.  The script uses createdOn of the latest
patch set.  That's the timestamp of when it was written, not posted.
The timestamp we want is in the gerrit UI, but not this data, as far as
I can tell.

This is indeed throwing the times for some reviews *way* off.  I'm not
sure of the best way to fix this, yet.

> {   'age': 1347593,
>     u'branch': u'master',
>     u'createdOn': 1368478580,
>     u'id': u'I19fa61d467edd5a7572040d084824972569ef65a',
>     u'lastUpdated': 1369825893,
>     u'number': u'29005',
>     u'open': True,
>     u'owner': {   u'email': u'mriedem at us.ibm.com
> <mailto:u%27mriedem at us.ibm.com>',
>                   u'name': u'Matt Riedemann',
>                   u'username': u'mriedem'},
>     u'patchSets': [   {   u'createdOn': 1368478580,
>                           u'number': u'1',
>                           u'ref': u'refs/changes/05/29005/1',
>                           u'revision':
> u'f48bf4436c37286bf02984b8d2f02a53d13ff3f1',
>                           u'uploader': {   u'email':
> u'mriedem at us.ibm.com <mailto:u%27mriedem at us.ibm.com>',
>                                            u'name': u'Matt Riedemann',
>                                            u'username': u'mriedem'}},
>                       {   u'createdOn': 1368478887,
>                           u'number': u'2',
>                           u'ref': u'refs/changes/05/29005/2',
>                           u'revision':
> u'fdac01fc273326f1af0bf229b288cda21341dbf4',
>                           u'uploader': {   u'email':
> u'mriedem at us.ibm.com <mailto:u%27mriedem at us.ibm.com>',
>                                            u'name': u'Matt Riedemann',
>                                            u'username': u'mriedem'}},
>                       {   u'approvals': [   {   u'by': {   u'name':
> u'Jenkins',
>                                                            u'username':
> u'jenkins'},
>                                                 u'description': u'Verified',
>                                                 u'grantedOn': 1368482163,
>                                                 u'type': u'VRIF',
>                                                 u'value': u'1'},
>                                             {   u'by': {   u'name':
> u'SmokeStack',
>                                                            u'username':
> u'smokestack'},
>                                                 u'description': u'Verified',
>                                                 u'grantedOn': 1368481167,
>                                                 u'type': u'VRIF',
>                                                 u'value': u'1'},
>                                             {   u'by': {   u'email':
> u'dms at danplanet.com <mailto:u%27dms at danplanet.com>',
>                                                            u'name':
> u'Dan Smith',
>                                                            u'username':
> u'danms'},
>                                                 u'description': u'Code
> Review',
>                                                 u'grantedOn': 1368496486,
>                                                 u'type': u'CRVW',
>                                                 u'value': u'-1'}],
> <snip>
>                        {   u'approvals': [   {   u'by': {   u'name':
> u'Jenkins',
>                                                            u'username':
> u'jenkins'},
>                                                 u'description': u'Verified',
>                                                 u'grantedOn': 1369450189,
>                                                 u'type': u'VRIF',
>                                                 u'value': u'1'},
>                                             {   u'by': {   u'email':
> u'john at johngarbutt.com <mailto:u%27john at johngarbutt.com>',
>                                                            u'name':
> u'John Garbutt',
>                                                            u'username':
> u'johngarbutt'},
>                                                 u'description': u'Code
> Review',
>                                                 u'grantedOn': 1369825893,
>                                                 u'type': u'CRVW',
>                                                 u'value': u'1'},
>                                             {   u'by': {   u'name':
> u'SmokeStack',
>                                                            u'username':
> u'smokestack'},
>                                                 u'description': u'Verified',
>                                                 u'grantedOn': 1369448293,
>                                                 u'type': u'VRIF',
>                                                 u'value': u'1'},
>                                             {   u'by': {   u'email':
> u'dms at danplanet.com <mailto:u%27dms at danplanet.com>',
>                                                            u'name':
> u'Dan Smith',
>                                                            u'username':
> u'danms'},
>                                                 u'description': u'Code
> Review',
>                                                 u'grantedOn': 1369501382,
>                                                 u'type': u'CRVW',
>                                                 u'value': u'2'}],
>                           u'createdOn': 1368478580,
>                           u'number': u'17',
>                           u'ref': u'refs/changes/05/29005/17',
>                           u'revision':
> u'ff99601a18f89c92cda5974cd5592cd6e2762c93',
>                           u'uploader': {   u'email':
> u'mriedem at us.ibm.com <mailto:u%27mriedem at us.ibm.com>',
>                                            u'name': u'Matt Riedemann',
>                                            u'username': u'mriedem'}}],
>     u'project': u'openstack/nova',
>     u'sortKey': u'002562bf0000714d',
>     u'status': u'NEW',
>     u'subject': u'Set resized instance back to original vm_state',
>     u'topic': u'bug/1177811',
>     u'url': u'https://review.openstack.org/29005'}


-- 
Russell Bryant



More information about the OpenStack-dev mailing list