Use all stats while calculating reviews by company
While obtaining stats for particilar core reviewer teamstats script ignores the case when person changes company. In this case, "stats" data in responce obj includes more than one stat, but only first one is taken now. This patch fixes this issue. Change-Id: I3a588c0fc742b3e123eb32623315fdf2894ce7c9
This commit is contained in:
parent
1d361a81f6
commit
aca45f3054
@ -102,17 +102,16 @@ def get_core_reviews_by_company(group):
|
|||||||
for eng in reviews['stats']:
|
for eng in reviews['stats']:
|
||||||
if eng['core'] != 'master':
|
if eng['core'] != 'master':
|
||||||
continue
|
continue
|
||||||
company = s.get('http://stackalytics.com/api/1.0/'
|
for stat in s.get('http://stackalytics.com/api/1.0/stats/'
|
||||||
'stats/companies?metric=marks&'
|
'companies?metric=marks&module=%s&user_id=%s&'
|
||||||
'module=%s&user_id=%s&project_type=all'
|
'project_type=all&release=all&start_date=%s' %
|
||||||
'&release=all&start_date=%s'
|
(group, eng['id'], six_months)).json()['stats']:
|
||||||
% (group, eng['id'],
|
company = stat['id']
|
||||||
six_months)).json()['stats'][0]['id']
|
companies.setdefault(company, {'reviewers': 0, 'reviews': 0})
|
||||||
companies.setdefault(company, {'reviewers': 0, 'reviews': 0})
|
|
||||||
|
|
||||||
if eng['metric'] >= MIN_REVIEWS or eng['metric'] >= min_percent:
|
if eng['metric'] >= MIN_REVIEWS or eng['metric'] >= min_percent:
|
||||||
companies[company]['reviews'] += eng['metric']
|
companies[company]['reviews'] += stat['metric']
|
||||||
companies[company]['reviewers'] += 1
|
companies[company]['reviewers'] += 1
|
||||||
|
|
||||||
return companies
|
return companies
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user