Skip to content

Commit

Permalink
Remove unneeded resource metric
Browse files Browse the repository at this point in the history
Signed-off-by: Isaac Milarsky <[email protected]>
  • Loading branch information
IsaacMilarky committed Jan 23, 2024
1 parent fff99fe commit 2e7f392
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 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, ResourceMetric
from metricsLib.metrics_data_structures import GraphQLMetric, SumMetric
from metricsLib.metrics_data_structures import ListMetric
from metricsLib.constants import TOKEN, AUGUR_HOST

Expand Down Expand Up @@ -138,9 +138,9 @@

# 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 +177,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
2 changes: 1 addition & 1 deletion scripts/metricsLib/oss_metric_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def __init__(self, repo_git_url, owner_id):
repo_val = next(
x for x in response_json if x['repo_name'] and x['repo_name'].lower() == repo_name.lower())
except StopIteration:
print(f"Could not find repo in group {owner_id}")
print(f"Could not find repo {repo_git_url} in group {owner_id}")
repo_val = {
'repo_id': None
}
Expand Down

0 comments on commit 2e7f392

Please sign in to comment.