diff --git a/scripts/benchmark-backtest-performance.sh b/scripts/benchmark-backtest-performance.sh index 60d7c801..9dfc4e47 100755 --- a/scripts/benchmark-backtest-performance.sh +++ b/scripts/benchmark-backtest-performance.sh @@ -76,23 +76,26 @@ WIN_RATE=$(echo "$TEST_OUTPUT" | grep "• Win Rate:" | sed 's/.*Win Rate: //' | GROWTH_PERCENTAGE=$(echo "$TEST_OUTPUT" | grep "• Growth:" | sed 's/.*Growth: //' | sed 's/%//' | sed 's/,/./g' | xargs) SCORE=$(echo "$TEST_OUTPUT" | grep "• Score:" | sed 's/.*Score: //' | sed 's/[^0-9.-]//g' | xargs) -# Set defaults for missing values +# Set defaults for missing or malformed values CANDLES_COUNT=${CANDLES_COUNT:-0} -EXECUTION_TIME=${EXECUTION_TIME:-0} -PROCESSING_RATE=${PROCESSING_RATE:-0} -MEMORY_START=${MEMORY_START:-0} -MEMORY_END=${MEMORY_END:-0} -MEMORY_PEAK=${MEMORY_PEAK:-0} -SIGNAL_UPDATES=${SIGNAL_UPDATES:-0} +EXECUTION_TIME=${EXECUTION_TIME:-0.0} +PROCESSING_RATE=${PROCESSING_RATE:-0.0} +MEMORY_START=${MEMORY_START:-0.0} +MEMORY_END=${MEMORY_END:-0.0} +MEMORY_PEAK=${MEMORY_PEAK:-0.0} +SIGNAL_UPDATES=${SIGNAL_UPDATES:-0.0} SIGNAL_SKIPPED=${SIGNAL_SKIPPED:-0} -SIGNAL_EFFICIENCY=${SIGNAL_EFFICIENCY:-0} -BACKTEST_STEPS=${BACKTEST_STEPS:-0} -AVG_SIGNAL_UPDATE=${AVG_SIGNAL_UPDATE:-0} -AVG_BACKTEST_STEP=${AVG_BACKTEST_STEP:-0} -FINAL_PNL=${FINAL_PNL:-0} +SIGNAL_EFFICIENCY=${SIGNAL_EFFICIENCY:-0.0} +BACKTEST_STEPS=${BACKTEST_STEPS:-0.0} +AVG_SIGNAL_UPDATE=${AVG_SIGNAL_UPDATE:-0.0} +AVG_BACKTEST_STEP=${AVG_BACKTEST_STEP:-0.0} +FINAL_PNL=${FINAL_PNL:-0.00} WIN_RATE=${WIN_RATE:-0} -GROWTH_PERCENTAGE=${GROWTH_PERCENTAGE:-0} -SCORE=${SCORE:-0} +GROWTH_PERCENTAGE=${GROWTH_PERCENTAGE:-0.00} +SCORE=${SCORE:-0.00} + +# Fix malformed values +SCORE=$(echo "$SCORE" | sed 's/^0*$/0.00/' | xargs) # Create CSV row CSV_ROW="$TIMESTAMP,ExecuteBacktest_With_Large_Dataset_Should_Show_Performance_Telemetry,$CANDLES_COUNT,$EXECUTION_TIME,$PROCESSING_RATE,$MEMORY_START,$MEMORY_END,$MEMORY_PEAK,$SIGNAL_UPDATES,$SIGNAL_SKIPPED,$SIGNAL_EFFICIENCY,$BACKTEST_STEPS,$AVG_SIGNAL_UPDATE,$AVG_BACKTEST_STEP,$FINAL_PNL,$WIN_RATE,$GROWTH_PERCENTAGE,$SCORE,$COMMIT_HASH,$BRANCH_NAME,$ENVIRONMENT" diff --git a/src/Managing.Workers.Tests/performance-benchmarks.csv b/src/Managing.Workers.Tests/performance-benchmarks.csv index 410950ef..f2f5a4df 100644 --- a/src/Managing.Workers.Tests/performance-benchmarks.csv +++ b/src/Managing.Workers.Tests/performance-benchmarks.csv @@ -7,3 +7,5 @@ DateTime,TestName,CandlesCount,ExecutionTimeSeconds,ProcessingRateCandlesPerSec, 2025-11-11T04:31:06Z,ExecuteBacktest_With_Large_Dataset_Should_Show_Performance_Telemetry,5760,2.14 2.17,2658.3,15.28,17.89,23.73,1875.99,3814,33.1,123.31,0.24,0.02,-2431.04,54,-2.43,0.00,47911c28,dev,development 2025-11-11T04:32:55Z,ExecuteBacktest_With_Large_Dataset_Should_Show_Performance_Telemetry,5760,1.41 1.43,40376,15.26,17.79,23.47,1186.69,3814,33.1,90.22,0.15,0.02,-243104,54,-243,000,47911c28,dev,development 2025-11-11T04:34:42Z,ExecuteBacktest_With_Large_Dataset_Should_Show_Performance_Telemetry,5760,2.61 2.63,2186.0,15.26,17.85,23.73,2329.99,3814,33.1,134.43,0.30,0.02,-2431.04,54,-2.43,0.00,47911c28,dev,development +2025-11-11T04:35:43Z,ExecuteBacktest_With_Large_Dataset_Should_Show_Performance_Telemetry,5760,1.845,3104.7,15.26,17.82,23.73,1586.43,3814,33.1,106.98,0.21,0.02,-2431.04,54,-2.43,000,47911c28,dev,development +2025-11-11T04:37:04Z,ExecuteBacktest_With_Large_Dataset_Should_Show_Performance_Telemetry,5760,2.115,2686.2,15.71,17.55,23.91,1762.82,3814,33.1,178.50,0.23,0.03,-2431.04,54,-2.43,0.00,567de2e5,dev,development