Skip to content

Commit

Permalink
Tc
Browse files Browse the repository at this point in the history
  • Loading branch information
msune committed Oct 10, 2024
1 parent c07f844 commit 2904c41
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,8 @@ jobs:
cd sfunnel/test/cni/
make VERBOSE=1 _check_perf
#Create the markdown report (TODO improve txt)
echo "# Performance report" >> $GITHUB_STEP_SUMMARY
echo "CNI: ${CNI}" >> $GITHUB_STEP_SUMMARY
echo "Number of nodes: ${NODES}" >> $GITHUB_STEP_SUMMARY
echo "## Results" >> $GITHUB_STEP_SUMMARY
cat .last_perf_report.txt >> $GITHUB_STEP_SUMMARY
#Create the markdown report
python3 perf/gen_report.py >> $GITHUB_STEP_SUMMARY
docker_build_test_publish:
needs: [check_unit, check_cni_example]
Expand Down
5 changes: 3 additions & 2 deletions test/cni/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,12 @@ _check_perf: _wait_up _wait_running
$(QUIET) echo "Workaround lingering old conntrack (metallb/kubeproxy bug?)..."
$(QUIET) for NODE in $$(minikube node list | awk '{print $$1}'); do minikube ssh -n $${NODE} "sudo conntrack -F"; done;
$(QUIET) echo "Launching iperf tests..."
$(QUIET) python3 perf/gen_report.py
DEBUG=1 NETNS=client python3 perf/check_perf.py
$(QUIET) echo "Unloading NDEBUG sfunnel in NS..."
$(QUIET) $(MAKE) _unload
$(QUIET) echo "Loading DEBUG sfunnel in NS..."
$(QUIET) $(MAKE) _load
$(QUIET) echo "Restoring nginx..."
$(QUIET) $(MAKE) _deploy
DEBUG=1 NETNS=client python3 perf/check_perf.py
$(QUIET) echo "Print report..."
$(QUIET) python3 perf/gen_report.py
18 changes: 16 additions & 2 deletions test/cni/perf/gen_report.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
import re
import json
import platform
import os

with open('.last_perf_report.json', 'r') as file:
data = json.load(file)

md_report = "# Test reports\n"
md_report = "# Performance report\n"
md_report += f"\n"

md_report += f"## General information \n"
md_report += f"\n"
md_report += f"Number of K8s nodes: {os.getenv('NODES', 'unknown')}\n"
md_report += f"CNI: {os.getenv('CNI', 'unknown')}\n"
md_report += f"\n"

md_report += f"## Runner info\n"
md_report += f"\n"
md_report += f"Architecture: {platform.machine()}\n"
md_report += f"Architecture: {platform.machine()}\n"
md_report += f"Kernel: {platform.release()}\n"
md_report += f"OS: {platform.system()}\n"
md_report += f"Hostname: {platform.node()}\n"
md_report += f"\n"

md_report += f"## Results\n"
md_report += f"\n"
for key, elem in data.items():
md_report += f"## Test: {key}\n"
md_report += f"### Fixture: {key}\n"
md_report += f"\n"
md_report += f"Number of workers: {elem['number_of_workers']}\n"
md_report += f"\n"
Expand Down

0 comments on commit 2904c41

Please sign in to comment.