Add extractors for 90 days experience (#285)

This commit is contained in:
Ayush Shridhar 2019-04-16 14:51:00 +05:30 коммит произвёл Marco
Родитель 74ec78472a
Коммит b480ed563b
1 изменённых файлов: 20 добавлений и 0 удалений

Просмотреть файл

@ -305,6 +305,16 @@ class commit_author_experience(object):
return sum(res) / len(res)
class commit_author_experience_90_days(object):
def __call__(self, bug, **kwargs):
res = [
commit["author_experience_90_days"]
for commit in bug["commits"]
if not commit["ever_backedout"]
]
return sum(res) / len(res)
class commit_reviewer_experience(object):
def __call__(self, bug, **kwargs):
res = [
@ -315,6 +325,16 @@ class commit_reviewer_experience(object):
return sum(res) / len(res)
class commit_reviewer_experience_90_days(object):
def __call__(self, bug, **kwargs):
res = [
commit["reviewer_experience_90_days"]
for commit in bug["commits"]
if not commit["ever_backedout"]
]
return sum(res) / len(res)
class commit_no_of_backouts(object):
def __call__(self, bug, **kwargs):
return sum(1 for commit in bug["commits"] if commit["ever_backedout"])