forked from ballerina-platform/ballerina-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03b5fb1
commit 23eb91d
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: LS perf tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- ls-perf-tests-8 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ubuntu_build: | ||
name: LS perf tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 75 | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17.0.7' | ||
|
||
- name: Initialize sub-modules | ||
run: git submodule update --init | ||
|
||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ github.sha }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
|
||
- name: Build with Gradle | ||
env: | ||
packageUser: ${{ github.actor }} | ||
packagePAT: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
export DISPLAY=':99.0' | ||
chmod +x perf_test.sh & ./perf_test.sh |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# Number of times to run the command | ||
num_runs=10 | ||
|
||
# Initialize sum variable | ||
sum=0 | ||
|
||
# Run the command multiple times | ||
for ((i=1; i<=$num_runs; i++)); do | ||
output=$(./gradlew :language-server:language-server-core:test --tests "org.ballerinalang.langserver.codeaction.CodeActionPerformanceTest") # Replace "your_command_here" with your actual command | ||
response_time=$(echo "$output" | grep -oP 'actualResponseTime: \K\d+') | ||
|
||
if [[ -n $response_time ]]; then | ||
sum=$((sum + response_time)) | ||
echo "Run $i - actualResponseTime: $response_time" | ||
else | ||
echo "Run $i - actualResponseTime not found in output" | ||
fi | ||
done | ||
|
||
# Calculate the average | ||
average=$((sum / num_runs)) | ||
|
||
echo "Average actualResponseTime: $average" | ||
|