feat: DPDK Market Data Feed Handler — production product app
Add complete market data gateway product: - app/market_feed.c: Zero-copy DPDK feed handler with latency histogram (min/avg/P50/P95/P99/max), per-symbol msg rate, periodic stats, signal handling, JSON parsing without library dependency. - demo/market_data_server.py: Zero-dependency simulated market data server (8 symbols, random walk pricing, subscribe/unsubscribe). - app/README.md: Full product documentation with architecture diagram. - Makefile: Add 'app' target for product build (build/market_feed). - src/main.c: Add -M market data streaming mode. Product is ready for: financial market data gateways, low-latency quote feeds, exchange connectivity testing. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -34,7 +34,17 @@ LDFLAGS = $(DPDK_LIBS) -lpthread -ldl -lnuma
|
||||
LDFLAGS += -Wl,--allow-multiple-definition
|
||||
LDFLAGS += -Wl,-rpath,$(DPDK_BUILD)/lib
|
||||
|
||||
.PHONY: all clean clean-all perf
|
||||
# Market Data Feed Handler (product app)
|
||||
FEED_SRCS := app/market_feed.c
|
||||
FEED_SRCS += src/tcp_core.c
|
||||
FEED_SRCS += src/tcp_input.c
|
||||
FEED_SRCS += src/tcp_output.c
|
||||
FEED_SRCS += src/tcp_timer.c
|
||||
FEED_SRCS += src/tcp_socket.c
|
||||
FEED_SRCS += src/ws_client.c
|
||||
FEED_OBJS := $(FEED_SRCS:%.c=$(BUILD_DIR)/%.o)
|
||||
|
||||
.PHONY: all clean clean-all perf app
|
||||
|
||||
all: $(BUILD_DIR)/$(APP)
|
||||
|
||||
@@ -71,3 +81,17 @@ clean:
|
||||
|
||||
clean-all: clean
|
||||
rm -f $(APP)
|
||||
|
||||
# ── Market Data Feed Handler (production app) ─────────────────
|
||||
|
||||
app: $(BUILD_DIR)/market_feed
|
||||
|
||||
$(BUILD_DIR)/market_feed: $(FEED_OBJS)
|
||||
@mkdir -p $(@D)
|
||||
PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" gcc $(FEED_OBJS) $(LDFLAGS) -o $@
|
||||
@echo " LINK $@"
|
||||
|
||||
$(BUILD_DIR)/app/%.o: app/%.c
|
||||
@mkdir -p $(@D)
|
||||
PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" gcc $(CFLAGS) -Isrc/ -MMD -c $< -o $@
|
||||
@echo " CC $<"
|
||||
|
||||
Reference in New Issue
Block a user