-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial infrastructure to generate the reports
- manuscripts2/metrics folder containing files for different metrics - bin/manuscripts2 to generate report from new_functions - manuscripts2/report.py to create the report using Report class
- Loading branch information
1 parent
6b25218
commit 49d04c1
Showing
7 changed files
with
395 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Script for producing Reports from data in ElasticSearch | ||
# | ||
# Copyright (C) 2018 CHAOSS | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
# Authors: | ||
# Pranjal Aswani <aswani.pranjal@gmail.com> | ||
# | ||
|
||
import sys | ||
sys.path.insert(0, '.') | ||
|
||
from manuscripts2.report import Report | ||
|
||
test_report = Report(data_dir="PERCEVAL_TESTS", data_sources=['git', 'github_issues', 'github_prs']) | ||
test_report.get_activity_metrics() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# | ||
# Copyright (C) 2018 CHAOSS | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
# Author: | ||
# Pranjal Aswani <aswani.pranjal@gmail.com> | ||
# | ||
|
||
import sys | ||
sys.path.insert(0, '..') | ||
|
||
from manuscripts2.new_functions import Query | ||
|
||
|
||
class GitMetrics(): | ||
|
||
def __init__(self, index): | ||
|
||
self.name = "git" | ||
self.commits = Query(index) | ||
|
||
def get_section_metrics(self): | ||
|
||
return { | ||
"overview": { | ||
"activity_metrics": [self.commits.get_cardinality("hash").by_period()], | ||
"author_metrics": [], | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"projects_metrics": [] | ||
}, | ||
"com_channels": { | ||
"activity_metrics": [], | ||
"author_metrics": [] | ||
}, | ||
"project_activity": { | ||
# TODO: Authors is not activity but we need two metrics here | ||
"metrics": [] | ||
}, | ||
"project_community": { | ||
"author_metrics": [], | ||
"people_top_metrics": [], | ||
"orgs_top_metrics": [], | ||
}, | ||
"project_process": { | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"time_to_close_title": "", | ||
"time_to_close_review_metrics": [], | ||
"time_to_close_review_title": "", | ||
"patchsets_metrics": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# | ||
# Copyright (C) 2018 CHAOSS | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
# Author: | ||
# Pranjal Aswani <aswani.pranjal@gmail.com> | ||
# | ||
|
||
import sys | ||
sys.path.insert(0, '..') | ||
|
||
from manuscripts2.derived_classes import Issues | ||
|
||
|
||
class IssuesMetrics(): | ||
|
||
def __init__(self, index): | ||
|
||
self.name = "github_issues" | ||
self.opened_issues = Issues(index) | ||
self.closed_issues = Issues(index) | ||
self.closed_issues.is_closed() | ||
|
||
def get_section_metrics(self): | ||
|
||
return { | ||
"overview": { | ||
"activity_metrics": [self.opened_issues.get_cardinality("id").by_period(), | ||
self.closed_issues.get_cardinality("id").by_period()], | ||
"author_metrics": [], | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"projects_metrics": [] | ||
}, | ||
"com_channels": { | ||
"activity_metrics": [], | ||
"author_metrics": [] | ||
}, | ||
"project_activity": { | ||
"metrics": [] | ||
}, | ||
"project_community": { | ||
"author_metrics": [], | ||
"people_top_metrics": [], | ||
"orgs_top_metrics": [], | ||
}, | ||
"project_process": { | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"time_to_close_title": "Days to close (median and average)", | ||
"time_to_close_review_metrics": [], | ||
"time_to_close_review_title": "", | ||
"patchsets_metrics": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# | ||
# Copyright (C) 2018 CHAOSS | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
# Author: | ||
# Pranjal Aswani <aswani.pranjal@gmail.com> | ||
# | ||
|
||
import sys | ||
sys.path.insert(0, '..') | ||
|
||
from manuscripts2.derived_classes import PullRequests | ||
|
||
|
||
class PullRequestsMetrics(): | ||
|
||
def __init__(self, index): | ||
|
||
self.name = "github_prs" | ||
self.opened_prs = PullRequests(index) | ||
self.closed_prs = PullRequests(index) | ||
self.closed_prs.is_closed() | ||
|
||
def get_section_metrics(self): | ||
|
||
return { | ||
"overview": { | ||
"activity_metrics": [self.opened_prs.get_cardinality("id").by_period(), | ||
self.closed_prs.get_cardinality("id").by_period()], | ||
"author_metrics": [], | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"projects_metrics": [] | ||
}, | ||
"com_channels": { | ||
"activity_metrics": [], | ||
"author_metrics": [] | ||
}, | ||
"project_activity": { | ||
"metrics": [] | ||
}, | ||
"project_community": { | ||
"author_metrics": [], | ||
"people_top_metrics": [], | ||
"orgs_top_metrics": [], | ||
}, | ||
"project_process": { | ||
"bmi_metrics": [], | ||
"time_to_close_metrics": [], | ||
"time_to_close_title": "Days to close (median and average)", | ||
"time_to_close_review_metrics": [], | ||
"time_to_close_review_title": "Days to close review (median and average)", | ||
"patchsets_metrics": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.