Skip to content

Commit

Permalink
enable all metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Milarsky <[email protected]>
  • Loading branch information
IsaacMilarky committed Feb 27, 2024
1 parent ff065e9 commit 22f36df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 2 additions & 0 deletions scripts/metricsLib/metrics_data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ def get_values(self, oss_entity, params=None):
if r.status_code == 200:
with open(path, "wb+") as f:
f.write(r.content)

print(f"Path: {path}")
else:
print(f"Status code: {r.status_code}")
return {}
Expand Down
32 changes: 15 additions & 17 deletions scripts/metricsLib/metrics_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Definitions of specific metrics for metricsLib
"""
from metricsLib.metrics_data_structures import CustomMetric, parse_commits_by_month
from metricsLib.metrics_data_structures import GraphQLMetric, SumMetric
from metricsLib.metrics_data_structures import GraphQLMetric, SumMetric, ResourceMetric
from metricsLib.metrics_data_structures import ListMetric
from metricsLib.constants import TOKEN, AUGUR_HOST

Expand Down Expand Up @@ -136,11 +136,9 @@
"period={period}&begin_date={begin_month}&end_date={end_date}",
{"new_issues_by_day_over_last_six_months": ["date", "issues"]}))

# TODO: Ask Sean why this endpoint isn't working for any repo except for augur.
# might just be lack of data.
#RESOURCE_METRICS.append(ResourceMetric("firstResponseForClosedPR", sixMonthsParams,
# AUGUR_HOST + "/pull_request_reports/PR_time_to_first_response/" +
# "?repo_id={repo_id}&start_date={begin_month}&end_date={end_date}"))
RESOURCE_METRICS.append(ResourceMetric("firstResponseForClosedPR", sixMonthsParams,
AUGUR_HOST + "/pull_request_reports/PR_time_to_first_response/" +
"?repo_id={repo_id}&start_date={begin_month}&end_date={end_date}"))


ORG_GITHUB_GRAPHQL_QUERY = """
Expand Down Expand Up @@ -177,17 +175,17 @@
FOLLOWERS_ENDPOINT, "followers_count", token=TOKEN)
)

#ORG_METRICS.append(ListMetric("issueNewWeekly", ["repo_group_id","period","begin_week","end_date"],
# AUGUR_HOST +
# "/repo-groups/{repo_group_id}/issues-new" +
# "?period={period}&begin_date={begin_week}&end_date={end_date}",
# {"new_issues_by_day_over_last_month": ["date", "issues"]}))

#ORG_METRICS.append(ListMetric("issueNewMonthly",["repo_group_id","period","begin_month","end_date"],
# AUGUR_HOST +
# "/repo-groups/{repo_group_id}/issues-new" +
# "?period={period}&begin_date={begin_month}&end_date={end_date}",
# {"new_issues_by_day_over_last_six_months": ["date", "issues"]}))
ORG_METRICS.append(ListMetric("issueNewWeekly", ["repo_group_id","period","begin_week","end_date"],
AUGUR_HOST +
"/repo-groups/{repo_group_id}/issues-new" +
"?period={period}&begin_date={begin_week}&end_date={end_date}",
{"new_issues_by_day_over_last_month": ["date", "issues"]}))

ORG_METRICS.append(ListMetric("issueNewMonthly",["repo_group_id","period","begin_month","end_date"],
AUGUR_HOST +
"/repo-groups/{repo_group_id}/issues-new" +
"?period={period}&begin_date={begin_month}&end_date={end_date}",
{"new_issues_by_day_over_last_six_months": ["date", "issues"]}))

COMMITS_ENDPOINT = "https://api.github.com/repos/{owner}/{repo}/commits"
SIMPLE_METRICS.append(CustomMetric("getCommitsByMonth", [
Expand Down

0 comments on commit 22f36df

Please sign in to comment.