summaryrefslogtreecommitdiff
path: root/profiling/profile_benchmarks.sh
diff options
context:
space:
mode:
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}"