diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26a4c7af..2041cb55 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -405,8 +405,12 @@ jobs: summary.push([compiler, pre(ms.format(min)), pre(ms.format(avg)), pre(ms.format(max)), pre(dec.format(stddev)), pre(`${dec.format(avg / fastest)}x`)].join(" | ")); const key = 'duration-' + compiler; const value = avg; + const slowdownKey = compiler + '-slowdown'; + const slowdownValue = dec.format(avg / fastest); fs.appendFileSync(outputFilePath, `${key}=${value} + `) + fs.appendFileSync(outputFilePath, `${slowdownKey}=${slowdownValue} `) } summary.push(""); @@ -414,6 +418,7 @@ jobs: fs.appendFileSync(process.env.GITHUB_STEP_SUMMARY, summary.join("\n"), "utf-8"); EOF - name: Authenticate Via OIDC Role + if: github.ref == 'refs/heads/main' uses: aws-actions/configure-aws-credentials@v4 with: aws-region: us-east-1 @@ -422,6 +427,8 @@ jobs: role-session-name: github-diff-action@cdk-ops output-credentials: true - name: Publish Metrics + if: github.ref == 'refs/heads/main' run: |- aws cloudwatch put-metric-data --metric-name TSC-average --namespace JsiiPerformance --value ${{ steps.output_summary.outputs.duration-tsc }} aws cloudwatch put-metric-data --metric-name JSII-average --namespace JsiiPerformance --value ${{ steps.output_summary.outputs.duration-jsii }} + aws cloudwatch put-metric-data --metric-name JSII-slowdown --namespace JsiiPerformance --value ${{ steps.output_summary.outputs.jsii-slowdown }} diff --git a/projenrc/benchmark-test.ts b/projenrc/benchmark-test.ts index c1e08c40..4cf0260e 100644 --- a/projenrc/benchmark-test.ts +++ b/projenrc/benchmark-test.ts @@ -118,8 +118,11 @@ export class BenchmarkTest { ' summary.push([compiler, pre(ms.format(min)), pre(ms.format(avg)), pre(ms.format(max)), pre(dec.format(stddev)), pre(`${dec.format(avg / fastest)}x`)].join(" | "));', ` const key = 'duration-' + compiler;`, ` const value = avg;`, + ` const slowdownKey = compiler + '-slowdown';`, + ` const slowdownValue = dec.format(avg / fastest);`, '', ' fs.appendFileSync(outputFilePath, `${key}=${value}\n`)', + ' fs.appendFileSync(outputFilePath, `${slowdownKey}=${slowdownValue}\n`)', '}', 'summary.push("");', '', @@ -129,6 +132,7 @@ export class BenchmarkTest { }, { name: 'Authenticate Via OIDC Role', + if: `github.ref == 'refs/heads/main'`, uses: 'aws-actions/configure-aws-credentials@v4', with: { 'aws-region': 'us-east-1', @@ -140,9 +144,11 @@ export class BenchmarkTest { }, { name: 'Publish Metrics', + if: `github.ref == 'refs/heads/main'`, run: [ 'aws cloudwatch put-metric-data --metric-name TSC-average --namespace JsiiPerformance --value ${{ steps.output_summary.outputs.duration-tsc }}', 'aws cloudwatch put-metric-data --metric-name JSII-average --namespace JsiiPerformance --value ${{ steps.output_summary.outputs.duration-jsii }}', + 'aws cloudwatch put-metric-data --metric-name JSII-slowdown --namespace JsiiPerformance --value ${{ steps.output_summary.outputs.jsii-slowdown }}', ].join('\n'), }, ],