Skip to content

Commit

Permalink
Update upload_to_cloudwatch_metrics.py
Browse files Browse the repository at this point in the history
  • Loading branch information
amazreech authored Jun 5, 2024
1 parent 9eb1131 commit e81e45c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/upload_to_cloudwatch_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,21 @@
metric_data = []
for contributor in data:
contributor_name = contributor['author']['login']
for week in contributor['weeks']:
metric_data.append({
'MetricName': 'Commits',
'Dimensions': [
{'Name': 'Contributor',
'Value': contributor_name}
],
'Timestamp': int(week['w']),
'Value': week['c'],
'Unit': 'Count'
})

response = client.put_metric_data(
Namespace = NAMESPACE,
MetricData = metric_data
)

print(f"Data uploaded to CloudWatch namespace {NAMESPACE}")

0 comments on commit e81e45c

Please sign in to comment.