Skip to content

Night Statistics Monitoring #701

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

Merged
merged 45 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
582ecdf
add collecting coverage
Jul 28, 2022
54b77f5
add monitoring tool
Aug 2, 2022
cf7bd12
add history updater
Aug 3, 2022
9bbea53
add rendering graphs
SBOne-Kenobi Aug 3, 2022
855d842
update gradle
Aug 4, 2022
42244c8
add more run tries
Aug 4, 2022
5b6f622
add force child process stopping
Aug 8, 2022
60dab2e
update stats transforming
Aug 8, 2022
1dc960f
add github action
Aug 8, 2022
2512ea3
rename action
Aug 8, 2022
43d0947
add documentation
Aug 8, 2022
49526c9
formatting changes
Aug 10, 2022
354bad8
rename tc to testcases
Aug 10, 2022
810e3da
add coverage statistics by source
Aug 10, 2022
b92e067
update examples
Aug 11, 2022
f55f3cd
replace Pair to data class
Aug 15, 2022
a15c16c
optimize coverage storage
Aug 15, 2022
01163cd
fix script
Aug 15, 2022
9b8bb28
add settings description
Aug 15, 2022
3744486
add monitoring settings
Aug 15, 2022
e2818f1
fix jdk path providing
Aug 15, 2022
255c10f
update documentation
Aug 15, 2022
e72fc73
add metadata insertion script
SBOne-Kenobi Aug 17, 2022
4565c0a
add script to build aggregated data
SBOne-Kenobi Aug 17, 2022
0498a1b
update docs
Aug 17, 2022
3c21894
update docs
Aug 18, 2022
d913726
update comments and name
Aug 18, 2022
8f25930
fix version bug
SBOne-Kenobi Aug 18, 2022
7269eee
update json format
Aug 19, 2022
a9eb958
update github action
Aug 19, 2022
bad21c0
update docs
Aug 19, 2022
027f473
update json structure
Aug 22, 2022
f79a417
update java version
Aug 22, 2022
addc03f
update target structure
Aug 22, 2022
ad7257a
fix container and asm
Aug 22, 2022
58e7a23
fix statistics naming and deprecated functions
Aug 22, 2022
8ea27fb
update examples
Aug 22, 2022
c5fae35
fix import
Aug 23, 2022
61d34d2
fix gradle instrumentation
Aug 24, 2022
65fc08e
update format
Aug 24, 2022
ed05c00
fix gradle
Aug 24, 2022
bcdf026
fix instrumentation jar
Aug 27, 2022
d53e7aa
fix github action
Aug 29, 2022
22ecbfc
provide comments for scripts
Aug 29, 2022
62d449e
optimize gradle
Aug 29, 2022
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
122 changes: 122 additions & 0 deletions .github/workflows/night-statistics-monitoring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: "UTBot Java: night statistics monitoring"

on:
schedule:
- cron: '0 0 * * *'

env:
data_branch: monitoring-data
data_path: monitoring/data
aggregated_data_branch: monitoring-aggregated-data
aggregated_data_path: monitoring/aggregated_data
monitoring_properties: monitoring/monitoring.properties
output_stats: stats.json

jobs:
build_and_run_monitoring:
runs-on: ubuntu-20.04
container: unittestbot/java-env:java11-zulu-jdk-fx-gradle7.4.2-kotlinc1.7.0
steps:
- name: Install git
run: |
apt-get upgrade -y
apt-get update -y
apt-get install git -y
git config --global --add safe.directory $(pwd)

- name: Checkout main
uses: actions/checkout@v3

- name: Checkout monitoring data
uses: actions/checkout@v3
with:
ref: ${{ env.data_branch }}
path: ${{ env.data_path }}

- name: Checkout aggregated monitoring data
uses: actions/checkout@v3
with:
ref: ${{ env.aggregated_data_branch }}
path: ${{ env.aggregated_data_path }}

- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Build and run monitoring UTBot Java
run: |
gradle :utbot-junit-contest:monitoringJar
java -jar \
-Dutbot.monitoring.settings.path=$monitoring_properties \
utbot-junit-contest/build/libs/monitoring.jar \
$output_stats

- name: Get current date
id: date
run: |
echo "::set-output name=date::$(date +'%Y-%m-%d')"
echo "::set-output name=timestamp::$(date +%s)"
echo "::set-output name=last_month::$(date --date='last month' +%s)"

- name: Get metadata
id: metadata
run: |
echo "::set-output name=commit::$(git rev-parse HEAD)"
echo "::set-output name=short_commit::$(git rev-parse --short HEAD)"
echo "::set-output name=branch::$(git name-rev --name-only HEAD)"
echo "::set-output name=build::$(date +'%Y.%-m')"

- name: Insert metadata
run: |
python monitoring/insert_metadata.py \
--stats_file $output_stats \
--output_file "$data_path/data-$branch-$date-$timestamp-$short_commit.json" \
--commit $commit \
--branch $branch \
--build "$build" \
--timestamp $timestamp \
--source_type "github-action" \
--source_id $run_id
env:
date: ${{ steps.date.outputs.date }}
timestamp: ${{ steps.date.outputs.timestamp }}
commit: ${{ steps.metadata.outputs.commit }}
short_commit: ${{ steps.metadata.outputs.short_commit }}
branch: ${{ steps.metadata.outputs.branch }}
build: ${{ steps.metadata.outputs.build }}
run_id: ${{ github.run_id }}

- name: Build aggregated data (last month)
run: |
python monitoring/build_aggregated_data.py \
--input_data_dir $data_path \
--output_file $aggregated_data_path/aggregated-data-$date.json \
--timestamp_from $timestamp_from \
--timestamp_to $timestamp
env:
date: ${{ steps.date.outputs.date }}
timestamp: ${{ steps.date.outputs.timestamp }}
timestamp_from: ${{ steps.date.outputs.last_month }}

- name: Commit and push statistics
uses: actions-js/push@master
with:
branch: ${{ env.data_branch }}
message: 'night-monitoring-${{ steps.date.outputs.date }}'
directory: ${{ env.data_path }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Commit and push aggregated statistics
uses: actions-js/push@master
with:
branch: ${{ env.aggregated_data_branch }}
message: 'night-monitoring-${{ steps.date.outputs.date }}'
directory: ${{ env.aggregated_data_path }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload logs
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: logs
path: logs/utbot.log
Loading