Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: only publish jsii metrics on main branch #1057

Merged
merged 2 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions projenrc/benchmark-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("");',
'',
Expand All @@ -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',
Expand All @@ -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'),
},
],
Expand Down
Loading