Skip to content

Commit 2c3fbfc

Browse files
committed
feat: add engine stress test (direct API) and MySQL wire protocol server
- engine_stress_test.cpp: multi-threaded benchmark calling Session<D> directly, each thread with its own Session/MultiRemoteExecutor/Arena, shared read-only catalog and shard map. Outputs JSON compatible with compare.py. - mysql_server.cpp: minimal MySQL wire protocol server (text protocol only) wrapping Session<D>, allowing standard MySQL clients to connect. Supports COM_QUERY, COM_QUIT, COM_PING, COM_INIT_DB. One thread per connection. - Makefile: added engine-stress and mysql-server build targets.
1 parent 79bec1b commit 2c3fbfc

3 files changed

Lines changed: 1817 additions & 1 deletion

File tree

Makefile

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,15 @@ SQLENGINE_TARGET = sqlengine
106106
BENCH_DISTRIBUTED_SRC = $(PROJECT_ROOT)/tools/bench_distributed.cpp
107107
BENCH_DISTRIBUTED_TARGET = bench_distributed
108108

109-
.PHONY: all lib test bench bench-compare bench-distributed build-corpus-test build-sqlengine clean
109+
# Engine stress test (direct API, multi-threaded)
110+
ENGINE_STRESS_SRC = $(PROJECT_ROOT)/tools/engine_stress_test.cpp
111+
ENGINE_STRESS_TARGET = engine_stress_test
112+
113+
# MySQL wire protocol server
114+
MYSQL_SERVER_SRC = $(PROJECT_ROOT)/tools/mysql_server.cpp
115+
MYSQL_SERVER_TARGET = mysql_server
116+
117+
.PHONY: all lib test bench bench-compare bench-distributed build-corpus-test build-sqlengine engine-stress mysql-server clean
110118

111119
build-corpus-test: $(CORPUS_TEST_TARGET)
112120

@@ -164,6 +172,18 @@ bench-distributed: $(BENCH_DISTRIBUTED_TARGET)
164172
$(BENCH_DISTRIBUTED_TARGET): $(BENCH_DISTRIBUTED_SRC) $(LIB_TARGET) $(ENGINE_OBJS)
165173
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(MYSQL_CFLAGS) $(PG_CFLAGS) -o $@ $< $(ENGINE_OBJS) -L$(PROJECT_ROOT) -lsqlparser -lpthread $(MYSQL_LIBS) $(PG_LIBS)
166174

175+
# Engine stress test
176+
engine-stress: $(ENGINE_STRESS_TARGET)
177+
178+
$(ENGINE_STRESS_TARGET): $(ENGINE_STRESS_SRC) $(LIB_TARGET) $(ENGINE_OBJS)
179+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(MYSQL_CFLAGS) $(PG_CFLAGS) -o $@ $< $(ENGINE_OBJS) -L$(PROJECT_ROOT) -lsqlparser -lpthread $(MYSQL_LIBS) $(PG_LIBS)
180+
181+
# MySQL wire protocol server
182+
mysql-server: $(MYSQL_SERVER_TARGET)
183+
184+
$(MYSQL_SERVER_TARGET): $(MYSQL_SERVER_SRC) $(LIB_TARGET) $(ENGINE_OBJS)
185+
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(MYSQL_CFLAGS) $(PG_CFLAGS) -o $@ $< $(ENGINE_OBJS) -L$(PROJECT_ROOT) -lsqlparser -lpthread $(MYSQL_LIBS) $(PG_LIBS)
186+
167187
$(CORPUS_TEST_TARGET): $(CORPUS_TEST_SRC) $(LIB_TARGET)
168188
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ $< -L$(PROJECT_ROOT) -lsqlparser
169189

@@ -192,4 +212,6 @@ clean:
192212
rm -f $(BENCH_COMPARE_OBJ) $(BENCH_COMPARE_TARGET)
193213
rm -f $(SQLENGINE_TARGET)
194214
rm -f $(BENCH_DISTRIBUTED_TARGET)
215+
rm -f $(ENGINE_STRESS_TARGET)
216+
rm -f $(MYSQL_SERVER_TARGET)
195217
@echo "Cleaned."

0 commit comments

Comments
 (0)