From fde61c3c967283ff07ac5dc0d4905c22cad10b1b Mon Sep 17 00:00:00 2001 From: Johannes Deml Date: Thu, 15 Apr 2021 17:12:06 +0200 Subject: [PATCH] Change save the process list after running the benchmarks Help reproducibility and reliability --- linux-benchmark.sh | 10 ++++++++++ win-benchmark.bat | 16 ++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/linux-benchmark.sh b/linux-benchmark.sh index f5a523a..812bbe0 100644 --- a/linux-benchmark.sh +++ b/linux-benchmark.sh @@ -1,5 +1,7 @@ #!/bin/bash +# build and run benchmark for linux + # Options: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build # Build targets: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog dotnet build --configuration Release --framework net5.0 --output ./bin/NetworkBenchmarkDotNet-Linux/ @@ -12,3 +14,11 @@ else fi ./bin/NetworkBenchmarkDotNet-Linux/NetworkBenchmarkDotNet -b "$mode" + +echo "--- Benchmark finished ---" +echo "Save current process list" +# Folder should exist, just to be sure create it if it does not +mkdir -p BenchmarkDotNet.Artifacts + +ps -aux > ./BenchmarkDotNet.Artifacts/running-processes.txt +ps -e -o %p, -o lstart -o ,%C, -o %mem -o ,%c > ./BenchmarkDotNet.Artifacts/running-processes.csv \ No newline at end of file diff --git a/win-benchmark.bat b/win-benchmark.bat index 8b648b4..54eb294 100644 --- a/win-benchmark.bat +++ b/win-benchmark.bat @@ -1,6 +1,4 @@ :: build and run benchmark for windows -:: Options: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build -:: Build targets: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog echo off Echo --- NBN Predefined Benchmark runner --- @@ -16,6 +14,20 @@ set benchmark=Essential set /p benchmark=Which benchmark do you want to run [Quick/Performance/Garbage/Essential] (default - %benchmark%)?: echo on +:: Options: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build +:: Build targets: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog dotnet build --configuration Release --framework net5.0 --output .\bin\NetworkBenchmarkDotNet-Windows\ .\bin\NetworkBenchmarkDotNet-Windows\NetworkBenchmarkDotNet -b %benchmark% + +echo off +Echo --- Benchmarks finished --- +Echo Save current process list +:: Folder should exist, just to be sure create it if it does not +if not exist "BenchmarkDotNet.Artifacts" mkdir BenchmarkDotNet.Artifacts + +echo on +:: Store currently running processes +tasklist /V /FO CSV > "BenchmarkDotNet.Artifacts\running-processes.csv" +tasklist /V > "BenchmarkDotNet.Artifacts\running-processes.txt" + PAUSE