Files
aitbc/scripts/benchmarking/compare-benchmarks.sh
aitbc 87e524e42c feat: enhance smart contract testing and deployment
- Add comprehensive test files for core contracts (ContractRegistry, TreasuryManager, AgentMarketplaceV2, EscrowService, DynamicPricing)
- Add Foundry fuzz tests for ContractRegistry, TreasuryManager, and AgentMarketplaceV2
- Add deployment automation scripts (deploy-automation.js, verify-deployment.js, monitor-contracts.js)
- Fix Hardhat/toolbox version compatibility in package.json
- Update smart-contract-tests.yml workflow to include deployment job
2026-04-29 10:44:40 +02:00

50 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Compare current benchmark results with previous runs
set -e
BENCHMARK_DIR="/var/lib/aitbc/benchmarks"
REPORT_DIR="/var/lib/aitbc/benchmarks/reports"
echo "=== Comparing Benchmark Results ==="
# Ensure directories exist
mkdir -p "$REPORT_DIR"
# Get latest benchmark files
LATEST_GAS=$(ls -t "$BENCHMARK_DIR"/gas-report-*.txt 2>/dev/null | head -1)
LATEST_EXECUTION=$(ls -t "$BENCHMARK_DIR"/execution-time-*.json 2>/dev/null | head -1)
LATEST_THROUGHPUT=$(ls -t "$BENCHMARK_DIR"/throughput-*.json 2>/dev/null | head -1)
# Get previous benchmark files
PREV_GAS=$(ls -t "$BENCHMARK_DIR"/gas-report-*.txt 2>/dev/null | head -2 | tail -1)
PREV_EXECUTION=$(ls -t "$BENCHMARK_DIR"/execution-time-*.json 2>/dev/null | head -2 | tail -1)
PREV_THROUGHPUT=$(ls -t "$BENCHMARK_DIR"/throughput-*.json 2>/dev/null | head -2 | tail -1)
echo "Latest gas report: $LATEST_GAS"
echo "Previous gas report: $PREV_GAS"
echo "Latest execution report: $LATEST_EXECUTION"
echo "Previous execution report: $PREV_EXECUTION"
echo "Latest throughput report: $LATEST_THROUGHPUT"
echo "Previous throughput report: $PREV_THROUGHPUT"
# Compare gas usage
if [[ -n "$LATEST_GAS" && -n "$PREV_GAS" ]]; then
echo "📊 Comparing gas usage..."
# Add actual comparison logic here
fi
# Compare execution time
if [[ -n "$LATEST_EXECUTION" && -n "$PREV_EXECUTION" ]]; then
echo "📊 Comparing execution time..."
# Add actual comparison logic here
fi
# Compare throughput
if [[ -n "$LATEST_THROUGHPUT" && -n "$PREV_THROUGHPUT" ]]; then
echo "📊 Comparing throughput..."
# Add actual comparison logic here
fi
echo "✅ Benchmark comparison complete"