test: production ingest E2E test suite with enhanced logging #55
@@ -98,8 +98,7 @@ CREATE TABLE IF NOT EXISTS role_prompt_mapping (
|
||||
active BOOLEAN DEFAULT true,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||
UNIQUE(project_id, role_name, prompt_id),
|
||||
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
|
||||
UNIQUE(project_id, role_name, prompt_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_role_prompt_mapping_role ON role_prompt_mapping(project_id, role_name, active);
|
||||
@@ -117,10 +116,12 @@ CREATE TABLE IF NOT EXISTS agent_metrics (
|
||||
p95_latency_ms FLOAT DEFAULT 0.0,
|
||||
p99_latency_ms FLOAT DEFAULT 0.0,
|
||||
error_rate FLOAT DEFAULT 0.0,
|
||||
recorded_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||
UNIQUE(project_id, agent_id, DATE(recorded_at))
|
||||
recorded_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
|
||||
);
|
||||
|
||||
-- Note: Use daily rollup job or materialized view for DATE(recorded_at) unique constraint
|
||||
-- PostgreSQL doesn't allow functions in UNIQUE constraints, so we use trigger-based rollup instead
|
||||
|
||||
CREATE INDEX idx_agent_metrics_agent ON agent_metrics(project_id, agent_id, recorded_at DESC);
|
||||
|
||||
-- Prompt Usage Log: detailed invocation tracking
|
||||
@@ -140,3 +141,4 @@ CREATE TABLE IF NOT EXISTS prompt_usage_log (
|
||||
|
||||
CREATE INDEX idx_prompt_usage_log_prompt ON prompt_usage_log(prompt_id, created_at DESC);
|
||||
CREATE INDEX idx_prompt_usage_log_agent ON prompt_usage_log(agent_id, created_at DESC);
|
||||
CREATE INDEX idx_prompt_usage_log_project ON prompt_usage_log(project_id, created_at DESC);
|
||||
|
||||
Reference in New Issue
Block a user