初始提交: Qihu-AIFlow v2.0.1 完整项目
- 前端 React+TypeScript (源码+构建产物) - 后端 Python FastAPI - 数据库迁移 001-015 - Docker部署配置 - 微信ClawBot API频道绑定 - 项目文档 README.md
This commit is contained in:
commit
78ff261b5a
199 files changed
+69126
No files matched your search
@@ -0,0 +1,34 @@
|
||||
-- 006 API调用统计与慢请求日志表
|
||||
-- 创建日期: 2026-05-29
|
||||
-- 说明: 用于API调用统计、慢请求记录
|
||||
|
||||
USE aiflow;
|
||||
|
||||
-- API调用统计表
|
||||
CREATE TABLE IF NOT EXISTS api_call_stats (
|
||||
id VARCHAR(36) PRIMARY KEY,
|
||||
endpoint VARCHAR(200) NOT NULL,
|
||||
method VARCHAR(10) NOT NULL,
|
||||
call_count BIGINT DEFAULT 0,
|
||||
total_response_time DOUBLE DEFAULT 0.0,
|
||||
error_count BIGINT DEFAULT 0,
|
||||
last_called_at DATETIME DEFAULT NULL,
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY uk_endpoint_method (endpoint, method),
|
||||
INDEX idx_acs_endpoint (endpoint),
|
||||
INDEX idx_acs_last_called (last_called_at)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- 慢请求记录表
|
||||
CREATE TABLE IF NOT EXISTS slow_request_logs (
|
||||
id VARCHAR(36) PRIMARY KEY,
|
||||
request_id VARCHAR(64) DEFAULT NULL,
|
||||
method VARCHAR(10) NOT NULL,
|
||||
endpoint VARCHAR(500) NOT NULL,
|
||||
status_code INT DEFAULT 0,
|
||||
response_time DOUBLE DEFAULT 0.0,
|
||||
threshold DOUBLE DEFAULT 3.0,
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
INDEX idx_srl_created (created_at)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
Reference in new issue
Block a user