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
| import java.util.Random; | |
| public class RandomExample { | |
| public static void main(String[] args) { | |
| Random rand = new Random(); | |
| int randomNumber = rand.nextInt(100) + 1; // 1 to 100 | |
| System.out.println("Random number: " + randomNumber); | |
| } | |
| } |
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 |
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
| - run: | |
| name: Evaluate benchmark results | |
| command: node scripts/eval_startup_benchmark_output.js | |
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
| - run: | |
| name: Download benchmark data | |
| command: | | |
| mkdir ~/benchmarks | |
| gsutil cp -r 'gs://android-sample-benchmarks/macrobenchmark/**/artifacts/sdcard/Download/*' ~/benchmarks | |
| gsutil rm -r gs://android-sample-benchmarks/macrobenchmark | |
| - store_artifacts: | |
| path: ~/benchmarks |
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
| - run: | |
| name: run on FTL | |
| command: | | |
| gcloud firebase test android run \ | |
| --type instrumentation \ | |
| --app app/build/outputs/apk/release/app-release.apk \ | |
| --test macrobenchmark/build/outputs/apk/release/macrobenchmark-release.apk \ | |
| --device model=flame,version=30,locale=en,orientation=portrait \ | |
| --directories-to-pull /sdcard/Download \ | |
| --results-bucket gs://android-sample-benchmarks \ |
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
| orbs: | |
| android: circleci/android@1.0.3 | |
| gcp-cli: circleci/gcp-cli@2.2.0 | |
| ... | |
| jobs: | |
| ... | |
| benchmarks-ftl: | |
| executor: |
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 val TARGET_PACKAGE = "com.circleci.samples.todoapp" | |
| fun MacrobenchmarkRule.measureStartup( | |
| profileCompiled: Boolean, | |
| startupMode: StartupMode, | |
| iterations: Int = 3, | |
| setupIntent: Intent.() -> Unit = {} | |
| ) = measureRepeated( | |
| packageName = TARGET_PACKAGE, | |
| metrics = listOf(StartupTimingMetric()), |
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
| @app.route('/ingest', methods=['POST']) | |
| def ingest(): | |
| files = request.files.getlist('file') | |
| results = [] | |
| for f in files: | |
| filename = f.filename | |
| # Read the file content as bytes for Ragie | |
| file_content = f.read() | |
| response = ragie.documents.create(request={ |
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
| | Column | Column | Column | | |
| | ------ | ------ | ------ | | |
| | | | | | |
| | | | | | |
| | | | | |
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
| function generateFibonacciSeries(n) { | |
| let series = [0, 1]; | |
| for (let i = 2; i < n; i++) { | |
| series[i] = series[i - 1] + series[i - 2]; | |
| } | |
| return series; | |
| } |
NewerOlder