forked from claude-did-this/claude-hub
cleanup: remove redundant shell scripts and update documentation
- Remove unused benchmark-startup.sh script - Remove redundant run-claudecode-interactive.sh wrapper - Remove test-claude.sh and test-container.sh (functionality covered by e2e tests) - Remove volume-test.sh (basic functionality covered by e2e tests) - Update docs/SCRIPTS.md to reflect actual repository state - Remove benchmark_results from .gitignore These scripts were either not referenced anywhere in the codebase or their functionality has been migrated to JavaScript E2E tests as noted in test/MIGRATION_NOTICE.md. Fixes #139 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,91 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Benchmark script for measuring spin-up times
|
||||
set -e
|
||||
|
||||
BENCHMARK_RUNS=${1:-3}
|
||||
COMPOSE_FILE=${2:-docker-compose.yml}
|
||||
|
||||
echo "Benchmarking startup time with $COMPOSE_FILE (${BENCHMARK_RUNS} runs)"
|
||||
echo "=============================================="
|
||||
|
||||
TOTAL_TIME=0
|
||||
RESULTS=()
|
||||
|
||||
for i in $(seq 1 $BENCHMARK_RUNS); do
|
||||
echo "Run $i/$BENCHMARK_RUNS:"
|
||||
|
||||
# Ensure clean state
|
||||
docker compose -f $COMPOSE_FILE down >/dev/null 2>&1 || true
|
||||
docker system prune -f >/dev/null 2>&1 || true
|
||||
|
||||
# Start timing
|
||||
START_TIME=$(date +%s%3N)
|
||||
|
||||
# Start service
|
||||
docker compose -f $COMPOSE_FILE up -d >/dev/null 2>&1
|
||||
|
||||
# Wait for health check to pass
|
||||
echo -n " Waiting for service to be ready."
|
||||
while true; do
|
||||
if curl -s -f http://localhost:8082/health >/dev/null 2>&1; then
|
||||
READY_TIME=$(date +%s%3N)
|
||||
break
|
||||
fi
|
||||
echo -n "."
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
ELAPSED=$((READY_TIME - START_TIME))
|
||||
TOTAL_TIME=$((TOTAL_TIME + ELAPSED))
|
||||
RESULTS+=($ELAPSED)
|
||||
|
||||
echo " Ready! (${ELAPSED}ms)"
|
||||
|
||||
# Get detailed startup metrics
|
||||
METRICS=$(curl -s http://localhost:8082/health | jq -r '.startup.totalElapsed // "N/A"')
|
||||
echo " App startup time: ${METRICS}ms"
|
||||
|
||||
# Clean up
|
||||
docker compose -f $COMPOSE_FILE down >/dev/null 2>&1
|
||||
|
||||
# Brief pause between runs
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "Results Summary:"
|
||||
echo "=============================================="
|
||||
|
||||
AVERAGE=$((TOTAL_TIME / BENCHMARK_RUNS))
|
||||
echo "Average startup time: ${AVERAGE}ms"
|
||||
|
||||
# Calculate min/max
|
||||
MIN=${RESULTS[0]}
|
||||
MAX=${RESULTS[0]}
|
||||
for time in "${RESULTS[@]}"; do
|
||||
[ $time -lt $MIN ] && MIN=$time
|
||||
[ $time -gt $MAX ] && MAX=$time
|
||||
done
|
||||
|
||||
echo "Fastest: ${MIN}ms"
|
||||
echo "Slowest: ${MAX}ms"
|
||||
echo "Individual results: ${RESULTS[*]}"
|
||||
|
||||
# Save results to file
|
||||
TIMESTAMP=$(date '+%Y%m%d_%H%M%S')
|
||||
RESULTS_FILE="benchmark_results_${TIMESTAMP}.json"
|
||||
|
||||
cat > $RESULTS_FILE << EOF
|
||||
{
|
||||
"timestamp": "$(date -Iseconds)",
|
||||
"compose_file": "$COMPOSE_FILE",
|
||||
"runs": $BENCHMARK_RUNS,
|
||||
"results_ms": [$(IFS=,; echo "${RESULTS[*]}")],
|
||||
"average_ms": $AVERAGE,
|
||||
"min_ms": $MIN,
|
||||
"max_ms": $MAX
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "Results saved to: $RESULTS_FILE"
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Test container with a volume mount for output
|
||||
OUTPUT_DIR="/tmp/claude-output"
|
||||
OUTPUT_FILE="$OUTPUT_DIR/output.txt"
|
||||
|
||||
echo "Docker Container Volume Test"
|
||||
echo "=========================="
|
||||
|
||||
# Ensure output directory exists and is empty
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
rm -f "$OUTPUT_FILE"
|
||||
|
||||
# Run container with volume mount for output
|
||||
docker run --rm \
|
||||
-v "$OUTPUT_DIR:/output" \
|
||||
claudecode:latest \
|
||||
bash -c "echo 'Hello from container' > /output/output.txt && echo 'Command executed successfully.'"
|
||||
|
||||
# Check if output file was created
|
||||
echo
|
||||
echo "Checking for output file: $OUTPUT_FILE"
|
||||
if [ -f "$OUTPUT_FILE" ]; then
|
||||
echo "Output file created. Contents:"
|
||||
cat "$OUTPUT_FILE"
|
||||
else
|
||||
echo "No output file was created."
|
||||
fi
|
||||
Reference in New Issue
Block a user