Skip to content

Commit

Permalink
feat: add jsii slowdown metric (#1056)
Browse files Browse the repository at this point in the history
Publishes the `JSII-slowdown` metric to CloudWatch. This will be used to
trigger an alarm if the JSII slowdown is > 3.

---

By submitting this pull request, I confirm that my contribution is made
under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0

Signed-off-by: Sumu <[email protected]>
  • Loading branch information
sumupitchayan authored Jun 7, 2024
1 parent 63cf995 commit 80d9601
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml

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

4 changes: 4 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 @@ -143,6 +146,7 @@ export class BenchmarkTest {
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

0 comments on commit 80d9601

Please sign in to comment.