summaryrefslogtreecommitdiff
path: root/profiling/profile_benchmarks.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-26 21:54:29 +0300
committerPaul Buetow <paul@buetow.org>2025-06-26 21:54:29 +0300
commit45613574ddfc6203ca31388ee7f6c60423f1cbd2 (patch)
tree603888f06861a927118fae0b4741df3faaa3155f /profiling/profile_benchmarks.sh
parent62d9774b4c2f776de60e8231fa6b8378d8afef4d (diff)
fix: update Makefile clean target and fix dmap profiling behavior
- Updated 'make clean' to also remove all .tmp and .prof files in the repo - Fixed dmap profiling scripts to let dmap complete naturally instead of killing it after a timeout (dmap terminates when input is fully processed) - Removed the special run_profile_dmap function as it's no longer needed - Updated all profiling scripts to reflect that dmap has a natural exit point Thanks for the correction - dmap does indeed terminate after processing all data from the source file, so the timeout/kill approach was unnecessary. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'profiling/profile_benchmarks.sh')
-rwxr-xr-xprofiling/profile_benchmarks.sh40
1 files changed, 4 insertions, 36 deletions
diff --git a/profiling/profile_benchmarks.sh b/profiling/profile_benchmarks.sh
index 4716192..d3fcabd 100755
--- a/profiling/profile_benchmarks.sh
+++ b/profiling/profile_benchmarks.sh
@@ -69,38 +69,6 @@ run_profile() {
echo
}
-# Special function for profiling dmap which runs continuously
-run_profile_dmap() {
- local cmd=$1
- local name=$2
- local args=$3
-
- echo -e "${GREEN}Profiling $cmd - $name${NC}"
-
- for i in $(seq 1 $PROFILE_RUNS); do
- echo " Run $i/$PROFILE_RUNS..."
- echo " Command: $cmd -profile -profiledir $PROFILE_DIR $args (will interrupt after 3s)"
-
- # Run dmap in background, wait a bit for it to process, then interrupt it
- $cmd -profile -profiledir "$PROFILE_DIR" $args > /dev/null 2>&1 &
- local pid=$!
-
- # Wait for dmap to process the file and generate initial results
- sleep 3
-
- # Send interrupt signal to make it exit cleanly
- # We expect this to return non-zero, so we ignore the exit code
- kill -INT $pid 2>/dev/null || true
- wait $pid 2>/dev/null || true
-
- echo " Completed"
-
- # Small delay between runs
- sleep 1
- done
-
- echo
-}
# Generate test data
echo -e "${GREEN}Preparing test data...${NC}"
@@ -165,13 +133,13 @@ if [ ! -f "$TEST_DATA_DIR/dtail_format.log" ]; then
fi
# Profile dmap with DTail format
-run_profile_dmap "../dmap" "simple_count" "-plain -cfg none -query 'from STATS select count(*)' -files $TEST_DATA_DIR/dtail_format.log"
-run_profile_dmap "../dmap" "aggregations" "-plain -cfg none -query 'from STATS select sum(\$goroutines),avg(\$cgocalls),max(lifetimeConnections)' -files $TEST_DATA_DIR/dtail_format.log"
-run_profile_dmap "../dmap" "group_by_connections" "-plain -cfg none -query 'from STATS select currentConnections,count(*) group by currentConnections' -files $TEST_DATA_DIR/dtail_format.log"
+run_profile "../dmap" "simple_count" "-plain -cfg none -query 'from STATS select count(*)' -files $TEST_DATA_DIR/dtail_format.log"
+run_profile "../dmap" "aggregations" "-plain -cfg none -query 'from STATS select sum(\$goroutines),avg(\$cgocalls),max(lifetimeConnections)' -files $TEST_DATA_DIR/dtail_format.log"
+run_profile "../dmap" "group_by_connections" "-plain -cfg none -query 'from STATS select currentConnections,count(*) group by currentConnections' -files $TEST_DATA_DIR/dtail_format.log"
# Also test CSV format
echo -e "\n${YELLOW}Testing CSV format with dmap${NC}"
-run_profile_dmap "../dmap" "csv_query" "-plain -cfg none -query 'select user,action,count(*) where status=\"success\" group by user,action logformat csv' -files $TEST_DATA_DIR/test.csv"
+run_profile "../dmap" "csv_query" "-plain -cfg none -query 'select user,action,count(*) where status=\"success\" group by user,action logformat csv' -files $TEST_DATA_DIR/test.csv"
echo
echo -e "${GREEN}Profiling complete!${NC}"