Created
January 12, 2026 02:28
-
-
Save maskaravivek/f2b1fc0fe310a6d6241ded961e79432e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const benchmarkData = require('/home/circleci/benchmarks/com.circleci.samples.todoapp.macrobenchmark-benchmarkData.json') | |
| const COLD_STARTUP_MEDIAN_THRESHOLD_MILIS = YOUR_COLD_THRESHOLD | |
| const WARM_STARTUP_MEDIAN_THRESHOLD_MILIS = YOUR_WARM_THRESHOLD | |
| const HOT_STARTUP_MEDIAN_THRESHOLD_MILIS = YOUR_HOT_THRESHOLD | |
| const coldMetrics = benchmarkData.benchmarks.find(element => element.params.mode === "COLD").metrics.startupMs | |
| const warmMetrics = benchmarkData.benchmarks.find(element => element.params.mode === "WARM").metrics.startupMs | |
| const hotMetrics = benchmarkData.benchmarks.find(element => element.params.mode === "HOT").metrics.startupMs | |
| let err = 0 | |
| let coldMsg = `Cold metrics median time - ${coldMetrics.median}ms ` | |
| let warmMsg = `Warm metrics median time - ${warmMetrics.median}ms ` | |
| let hotMsg = `Hot metrics median time - ${hotMetrics.median}ms ` | |
| if(coldMetrics.median > COLD_STARTUP_MEDIAN_THRESHOLD_MILIS){ | |
| err = 1 | |
| console.error(`${coldMsg} ❌ - OVER THRESHOLD ${COLD_STARTUP_MEDIAN_THRESHOLD_MILIS}ms`) | |
| } else { | |
| console.log(`${coldMsg} ✅`) | |
| } | |
| if(warmMetrics.median > WARM_STARTUP_MEDIAN_THRESHOLD_MILIS){ | |
| err = 1 | |
| console.error(`${warmMsg} ❌ - OVER THRESHOLD ${WARM_STARTUP_MEDIAN_THRESHOLD_MILIS}ms`) | |
| } else { | |
| console.log(`${warmMsg} ✅`) | |
| } | |
| if(hotMetrics.median > HOT_STARTUP_MEDIAN_THRESHOLD_MILIS){ | |
| err = 1 | |
| console.error(`${hotMsg} ❌ - OVER THRESHOLD ${HOT_STARTUP_MEDIAN_THRESHOLD_MILIS}ms`) | |
| } else { | |
| console.log(`${hotMsg} ✅`) | |
| } | |
| process.exit(err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment