test(gossipsub): Performance tests - plot latency history (#1608)

This commit is contained in:
Radosław Kamiński
2025-08-11 16:11:29 +01:00
committed by GitHub
parent 71f04d1bb3
commit abee5326dc
8 changed files with 239 additions and 29 deletions

View File

@@ -15,6 +15,10 @@ runs:
python -m pip install --upgrade pip
pip install matplotlib
- name: Run plot_metrics.py
- name: Plot Docker Stats
shell: bash
run: python performance/scripts/plot_docker_stats.py
run: python performance/scripts/plot_docker_stats.py
- name: Plot Latency History
shell: bash
run: python performance/scripts/plot_latency_history.py

View File

@@ -0,0 +1,34 @@
name: Publish Latency History
description: "Publish latency history CSVs in a configurable branch and folder"
runs:
using: "composite"
steps:
- name: Clone the branch
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}
ref: ${{ env.PUBLISH_BRANCH_NAME }}
path: ${{ env.CHECKOUT_SUBFOLDER_HISTORY }}
fetch-depth: 0
- name: Commit & push latency history CSVs
shell: bash
run: |
cd "$CHECKOUT_SUBFOLDER_HISTORY"
mkdir -p "$PUBLISH_DIR_LATENCY_HISTORY"
cp ../$SHARED_VOLUME_PATH/$LATENCY_HISTORY_PREFIX*.csv "$PUBLISH_DIR_LATENCY_HISTORY/"
git add "$PUBLISH_DIR_LATENCY_HISTORY"
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
else
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -m "Update latency history CSVs"
git push origin "$PUBLISH_BRANCH_NAME"
fi
cd ..

View File

@@ -24,7 +24,8 @@ runs:
mkdir -p $PUBLISH_DIR_PLOTS/$BRANCH_NAME
cp ../$SHARED_VOLUME_PATH/*.png $PUBLISH_DIR_PLOTS/$BRANCH_NAME/
git add $PUBLISH_DIR_PLOTS/$BRANCH_NAME
cp ../$LATENCY_HISTORY_PATH/*.png $PUBLISH_DIR_PLOTS/
git add $PUBLISH_DIR_PLOTS/*
if git diff-index --quiet HEAD --; then
echo "No changes to commit"

View File

@@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true
jobs:
examples:
performance:
timeout-minutes: 20
strategy:
fail-fast: false
@@ -34,6 +34,11 @@ jobs:
PUBLISH_BRANCH_NAME: "performance_plots"
CHECKOUT_SUBFOLDER_SUBPLOTS: "subplots"
PUBLISH_DIR_PLOTS: "plots"
CHECKOUT_SUBFOLDER_HISTORY: "history"
PUBLISH_DIR_LATENCY_HISTORY: "latency_history"
LATENCY_HISTORY_PATH: "history/latency_history"
LATENCY_HISTORY_PREFIX: "pr"
LATENCY_HISTORY_PLOT_FILENAME: "latency_history_all_scenarios.png"
name: "Performance"
runs-on: ubuntu-22.04
@@ -63,6 +68,9 @@ jobs:
- name: Process latency and docker stats
uses: ./.github/actions/process_stats
- name: Publish history
uses: ./.github/actions/publish_history
- name: Generate plots
uses: ./.github/actions/generate_plots