Skip to content

Commit cb49f1d

Browse files
committed
add both failure and success update
1 parent 57616ea commit cb49f1d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/pr-checks.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,19 @@ jobs:
8282
if: ${{ failure() }}
8383
run: |
8484
if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then
85-
echo "Integration test Failed. Putting Failure Metrics onto Cloudwatch"
85+
echo "Integration test Failed. Putting Failure Metrics = 1 and Success = 0 onto Cloudwatch"
8686
aws cloudwatch put-metric-data --metric-name IntegrationTestFailure --namespace SageMakerPySdkCoreMonitoringMetrics --value 1 --unit Count --dimensions MetricCategory=Integration
87+
aws cloudwatch put-metric-data --metric-name IntegrationTestSuccess --namespace SageMakerPySdkCoreMonitoringMetrics --value 0 --unit Count --dimensions MetricCategory=Integration
8788
else
8889
echo "Putting metrics has been skipped"
8990
fi
9091
- name: Put Success Metrics to CloudWatch
9192
if: ${{ success() }}
9293
run: |
9394
if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then
94-
echo "Integration test Succeeded. Putting Success Metrics onto Cloudwatch"
95+
echo "Integration test Succeeded. Putting Success Metrics = 1 and Failure = 0onto Cloudwatch"
9596
aws cloudwatch put-metric-data --metric-name IntegrationTestSuccess --namespace SageMakerPySdkCoreMonitoringMetrics --value 1 --unit Count --dimensions MetricCategory=Integration
97+
aws cloudwatch put-metric-data --metric-name IntegrationTestFailure --namespace SageMakerPySdkCoreMonitoringMetrics --value 0 --unit Count --dimensions MetricCategory=Integration
9698
else
9799
echo "Putting metrics has been skipped"
98100
fi
@@ -130,17 +132,19 @@ jobs:
130132
if: ${{ failure() }}
131133
run: |
132134
if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then
133-
echo "Unit test run Failed. Putting Failure Metrics onto Cloudwatch"
135+
echo "Unit test run Failed. Putting Failure Metrics = 1 and Success = 0 onto Cloudwatch"
134136
aws cloudwatch put-metric-data --metric-name UnitTestFailure --namespace SageMakerPySdkCoreMonitoringMetrics --value 1 --unit Count --dimensions MetricCategory=Unit-${{ matrix.python-version }}
137+
aws cloudwatch put-metric-data --metric-name UnitTestSuccess --namespace SageMakerPySdkCoreMonitoringMetrics --value 0 --unit Count --dimensions MetricCategory=Unit-${{ matrix.python-version }}
135138
else
136139
echo "Putting metrics has been skipped"
137140
fi
138141
- name: Put Success Metrics
139142
if: ${{ success() }}
140143
run: |
141144
if [[ "${{ github.event.pull_request.user.login }}" == ${{ secrets.SAGEMAKER_BOT_USER_LOGIN }} ]]; then
142-
echo "Unit test run Succeeded. Putting Success Metrics onto Cloudwatch"
145+
echo "Unit test run Succeeded. Putting Success Metrics = 1 and Failure = 0 onto Cloudwatch"
143146
aws cloudwatch put-metric-data --metric-name UnitTestSuccess --namespace SageMakerPySdkCoreMonitoringMetrics --value 1 --unit Count --dimensions MetricCategory=Unit-${{ matrix.python-version }}
147+
aws cloudwatch put-metric-data --metric-name UnitTestFailure --namespace SageMakerPySdkCoreMonitoringMetrics --value 0 --unit Count --dimensions MetricCategory=Unit-${{ matrix.python-version }}
144148
else
145149
echo "Putting metrics has been skipped"
146150
fi

0 commit comments

Comments
 (0)