chore: initial import

This commit is contained in:
phamnazage-jpg
2026-05-12 17:47:32 +08:00
commit fc54ba84b2
104 changed files with 11575 additions and 0 deletions

32
test/perf/drilldown_k6.js Normal file
View File

@@ -0,0 +1,32 @@
import http from 'k6/http';
import { check, sleep } from 'k6';
// AI-Ops 下钻性能压测脚本
// 目标:验证下钻加载 < 3s并发 20 用户
export const options = {
stages: [
{ duration: '30s', target: 20 },
{ duration: '2m', target: 20 },
{ duration: '30s', target: 0 },
],
thresholds: {
http_req_duration: ['p(95)<3000'], // P95 < 3s
http_req_failed: ['rate<0.01'], // 失败率 < 1%
},
};
export default function () {
const service = `service_${Math.floor(Math.random() * 10)}`;
const url = `http://localhost:8080/api/v1/ai-ops/metrics/drilldown?service=${service}&window=5m`;
const res = http.get(url, {
headers: { 'Authorization': 'Bearer ${__ENV.AI_OPS_TOKEN}' },
});
check(res, {
'status is 200': (r) => r.status === 200,
'response time < 3s': (r) => r.timings.duration < 3000,
});
sleep(2);
}