Skip to content

Commit

Permalink
[Cherry Pick] Enable canary report generation (awslabs#634)
Browse files Browse the repository at this point in the history
-enable canary report generation after each canary run.
  • Loading branch information
jsitu777 committed Apr 12, 2023
1 parent 0c0a8d0 commit 43c4ef4
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions tests/canary/scripts/push_stats_to_cloudwatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ def readXML_and_publish_metrics_to_cw():
failures = testsuite.attrib["failures"]
tests = testsuite.attrib["tests"]
successes = int(tests) - int(failures)
success_rate = successes/int(tests)*100
else:
failures = 0
successes = 0
tests = 0
success_rate = 0
tests = 1

timestamp = datetime.now().strftime("%Y-%m-%dT%H:%M:%S")

Expand Down Expand Up @@ -60,15 +58,6 @@ def readXML_and_publish_metrics_to_cw():
"Value": int(successes),
"Unit": "Count",
},
{
"MetricName": "success_rate",
"Timestamp": timestamp,
"Dimensions": [
{"Name": "CodeBuild Project Name", "Value": project_name},
],
"Value": int(success_rate),
"Unit": "Percent",
},
]

# Use the put_metric_data method to push the metric data to CloudWatch
Expand Down

0 comments on commit 43c4ef4

Please sign in to comment.