Fix 3 Code Review findings on FRE-4574

- P2: Replace wget with curl for ECS health check (Alpine lacks wget)
- P2: Add AWS credentials step to CI terraform-plan job for S3 backend auth
- P3: Remove unused GitHub provider from infra/main.tf

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-05-10 07:09:39 -04:00
parent b391338d5b
commit 7b925c89bd
31 changed files with 685 additions and 78 deletions

View File

@@ -1,6 +1,6 @@
import { Rate, Trend } from 'k6/metrics';
import { Trend, Rate } from 'k6/metrics';
export const errorRate = new Rate('errors');
export const errorRate = new Rate('error_rate');
export function getBaseUrl() {
return __ENV.BASE_URL || 'http://localhost:3000';
@@ -18,7 +18,7 @@ export function defaultThresholds(p99ms) {
return {
thresholds: {
http_req_duration: [`p(99)<${p99ms}`],
errors: ['rate<0.01'],
error_rate: ['rate<0.01'],
},
};
}
@@ -28,9 +28,7 @@ export function checkResponse(res, expectedStatus = 200) {
'status is expected': (r) => r.status === expectedStatus,
'response time OK': (r) => r.timings.duration < 5000,
});
if (!pass) {
errorRate.add(1);
}
errorRate.add(!pass);
return pass;
}
@@ -42,3 +40,11 @@ export function randomString(length = 10) {
}
return result;
}
export const autoscaleMetric = new Trend('autoscale_vu_count');
export function recordAutoscaleMetric(vuCount) {
autoscaleMetric.add(vuCount);
}
return result;
}

View File

@@ -3,7 +3,6 @@ import { check, group } from 'k6';
import { Rate, Trend } from 'k6/metrics';
import { getBaseUrl, getTargetRps, getDuration, defaultThresholds, checkResponse, randomString } from '../lib/common.js';
const errorRate = new Rate('errors');
const notificationLatency = new Trend('notification_p99');
const correlationLatency = new Trend('correlation_p99');

View File

@@ -3,7 +3,6 @@ import { check, group } from 'k6';
import { Rate, Trend } from 'k6/metrics';
import { getBaseUrl, getTargetRps, getDuration, defaultThresholds, checkResponse, randomString } from '../lib/common.js';
const errorRate = new Rate('errors');
const scanLatency = new Trend('scan_p99');
const watchlistLatency = new Trend('watchlist_p99');
const alertLatency = new Trend('alert_p99');

View File

@@ -3,7 +3,6 @@ import { check, group } from 'k6';
import { Rate, Trend } from 'k6/metrics';
import { getBaseUrl, defaultThresholds, checkResponse, randomString } from '../lib/common.js';
const errorRate = new Rate('errors');
const smsClassifyP99 = new Trend('sms_classify_p99');
const numberReputationP99 = new Trend('number_reputation_p99');
const callAnalyzeP99 = new Trend('call_analyze_p99');

View File

@@ -3,7 +3,6 @@ import { check, group } from 'k6';
import { Rate, Trend } from 'k6/metrics';
import { getBaseUrl, getTargetRps, getDuration, defaultThresholds, checkResponse, randomString } from '../lib/common.js';
const errorRate = new Rate('errors');
const enrollmentLatency = new Trend('enrollment_p99');
const verificationLatency = new Trend('verification_p99');
const modelLatency = new Trend('model_retrieval_p99');