From afba86489b00a2f5ac4d39b2853c2c51c2931536 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 26 Jun 2025 22:40:27 +0300 Subject: Remove bash scripts and update documentation to use dtail-tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following the successful refactoring to Go-based tooling, this commit: 1. Removes all obsolete bash scripts: - benchmarks/benchmark.sh - profiling/profile.sh - profiling/profile_benchmarks.sh - profiling/profile_dmap.sh - profiling/profile_quick.sh 2. Updates all documentation to use dtail-tools: - README.md: Updated benchmark commands to use dtail-tools - PROFILING.md: Updated profiling instructions to use dtail-tools 3. Updates Go code references: - profile_runner.go: Uses dtail-tools instead of profile.sh - profile_example.go: Uses dtail-tools for profile analysis The new dtail-tools provides all the functionality of the old bash scripts with better cross-platform compatibility, error handling, and maintainability. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- profiling/profile_quick.sh | 89 ---------------------------------------------- 1 file changed, 89 deletions(-) delete mode 100755 profiling/profile_quick.sh (limited to 'profiling/profile_quick.sh') diff --git a/profiling/profile_quick.sh b/profiling/profile_quick.sh deleted file mode 100755 index 249b73c..0000000 --- a/profiling/profile_quick.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -# Quick profile script for dtail commands -# This runs profiling with smaller datasets for faster results - -set -e - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd "$SCRIPT_DIR" - -# Colors for output -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -NC='\033[0m' # No Color - -# Default values -PROFILE_DIR="${PROFILE_DIR:-profiles}" -TEST_DATA_DIR="${TEST_DATA_DIR:-testdata}" - -# Create directories -mkdir -p "$PROFILE_DIR" -mkdir -p "$TEST_DATA_DIR" - -echo -e "${GREEN}DTail Quick Profiling${NC}" -echo "=====================" -echo - -# Generate test data if needed -if [ ! -f "$TEST_DATA_DIR/quick_test.log" ]; then - echo -e "${YELLOW}Generating test data...${NC}" - echo " Command: go run ../benchmarks/cmd/generate_profile_data.go -size \"10MB\" -output \"$TEST_DATA_DIR/quick_test.log\" -format log" - go run ../benchmarks/cmd/generate_profile_data.go -size "10MB" -output "$TEST_DATA_DIR/quick_test.log" -format log - echo " Command: go run ../benchmarks/cmd/generate_profile_data.go -size \"10MB\" -output \"$TEST_DATA_DIR/quick_test.csv\" -format csv" - go run ../benchmarks/cmd/generate_profile_data.go -size "10MB" -output "$TEST_DATA_DIR/quick_test.csv" -format csv -fi - -# Build commands -echo -e "${GREEN}Building commands...${NC}" -echo " Command: cd .. && make dcat dgrep dmap" -cd .. -make dcat dgrep dmap 2>/dev/null || true -cd "$SCRIPT_DIR" - -echo -echo -e "${GREEN}Running quick profiles...${NC}" - -# Profile dcat -echo -e "\n${YELLOW}Profiling dcat...${NC}" -echo "Command: ../dcat -profile -profiledir $PROFILE_DIR -plain -cfg none $TEST_DATA_DIR/quick_test.log" -../dcat -profile -profiledir "$PROFILE_DIR" -plain -cfg none "$TEST_DATA_DIR/quick_test.log" > /dev/null 2>&1 -DCAT_CPU=$(ls -t "$PROFILE_DIR"/dcat_cpu_*.prof 2>/dev/null | head -1) -if [ -n "$DCAT_CPU" ]; then - echo " Generated: $(basename "$DCAT_CPU")" - echo " Analysis: ../profiling/profile.sh -top 3 $DCAT_CPU" - ../profiling/profile.sh -top 3 "$DCAT_CPU" | grep -A 5 "Top 3 functions" -fi - -# Profile dgrep -echo -e "\n${YELLOW}Profiling dgrep...${NC}" -echo "Command: ../dgrep -profile -profiledir $PROFILE_DIR -plain -cfg none -regex \"user[0-9]+\" $TEST_DATA_DIR/quick_test.log" -../dgrep -profile -profiledir "$PROFILE_DIR" -plain -cfg none -regex "user[0-9]+" "$TEST_DATA_DIR/quick_test.log" > /dev/null 2>&1 -DGREP_CPU=$(ls -t "$PROFILE_DIR"/dgrep_cpu_*.prof 2>/dev/null | head -1) -if [ -n "$DGREP_CPU" ]; then - echo " Generated: $(basename "$DGREP_CPU")" - echo " Analysis: ../profiling/profile.sh -top 3 $DGREP_CPU" - ../profiling/profile.sh -top 3 "$DGREP_CPU" | grep -A 5 "Top 3 functions" -fi - -# Profile dmap (use proper MapReduce query on CSV file) -echo -e "\n${YELLOW}Profiling dmap...${NC}" -QUERY="select count($line),avg($duration) group by $user logformat csv" -echo "Command: ../dmap -profile -profiledir $PROFILE_DIR -plain -cfg none -query \"$QUERY\" -files $TEST_DATA_DIR/quick_test.csv" -# Run dmap and let it complete naturally -../dmap -profile -profiledir "$PROFILE_DIR" -plain -cfg none -query "$QUERY" -files "$TEST_DATA_DIR/quick_test.csv" > /dev/null 2>&1 - -DMAP_CPU=$(ls -t "$PROFILE_DIR"/dmap_cpu_*.prof 2>/dev/null | head -1) -if [ -n "$DMAP_CPU" ]; then - echo " Generated: $(basename "$DMAP_CPU")" - echo " Analysis: ../profiling/profile.sh -top 3 $DMAP_CPU" - ../profiling/profile.sh -top 3 "$DMAP_CPU" | grep -A 5 "Top 3 functions" -fi - -echo -echo -e "${GREEN}Quick profiling complete!${NC}" -echo -echo "To analyze in detail:" -echo " go tool pprof $PROFILE_DIR/" -echo " make profile-flamegraph PROFILE=$PROFILE_DIR/" -echo \ No newline at end of file -- cgit v1.2.3