Skip to content

Commit a749e1c

Browse files
committed
Added full and token generate only tests
Writes to local Prometheus
1 parent cc16684 commit a749e1c

File tree

8 files changed

+480
-25
lines changed

8 files changed

+480
-25
lines changed

performance-testing/uid2-operator/k6-test-resource.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ kind: K6
33
metadata:
44
name: k6-uid2-load-test
55
spec:
6-
parallelism: 4
7-
arguments: --out cloud
6+
parallelism: 3
7+
arguments: --out experimental-prometheus-rw --tag replacecomment
88
script:
99
configMap:
1010
name: operator-stress-test
11-
file: k6-uid2-operator-encrypt-inline.js
11+
file: replaced
12+
runner:
13+
env:
14+
- name: K6_PROMETHEUS_RW_SERVER_URL
15+
value: "http://prometheus-kube-prometheus-prometheus.svc.cluster.local:9090/api/v1/write"
16+
- name: K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM
17+
value: "true"

performance-testing/uid2-operator/k6-uid2-operator-encrypt-inline.js renamed to performance-testing/uid2-operator/k6-token-generate-refresh-identitymap.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
12
import { crypto } from "k6/experimental/webcrypto";
23
import encoding from 'k6/encoding';
34
import { check } from 'k6';
45
import http from 'k6/http';
56

6-
const generateVUs = 500;
7-
const refreshVUs = 500;
8-
const identityMapVUs = 500;
9-
const testDuration = '10m'
7+
const vus = 500;
8+
const baseUrl = "http://uid2-integ-opr-use2-alb-1278341514.us-east-2.elb.amazonaws.com";
9+
10+
const generateVUs = vus;
11+
const refreshVUs = vus;
12+
const identityMapVUs = vus;
13+
const testDuration = '20m'
14+
15+
const clientSecret = "";
16+
const clientKey = "";
1017

1118
//30 warm up on each
1219
// 5 min each
@@ -18,7 +25,6 @@ export const options = {
1825
noConnectionReuse: false,
1926
scenarios: {
2027
// Warmup scenarios
21-
2228
tokenGenerateWarmup: {
2329
executor: 'ramping-vus',
2430
exec: 'tokenGenerate',
@@ -67,7 +73,7 @@ export const options = {
6773
duration: testDuration,
6874
gracefulStop: '0s',
6975
startTime: '30s',
70-
},/*
76+
}/*,
7177
identityMapLargeBatchSequential: {
7278
executor: 'constant-vus',
7379
exec: 'identityMapLargeBatch',
@@ -114,11 +120,6 @@ for (let key in options.scenarios) {
114120
options.thresholds[thresholdName].push('max>=0');
115121
}
116122

117-
// Configs
118-
const clientSecret = __ENV.CLIENT_SECRET;
119-
const clientKey = __ENV.CLIENT_KEY;
120-
const baseUrl = __ENV.BASE_URL;
121-
122123
export async function setup() {
123124
var token = await generateRefreshRequest();
124125
return {
@@ -137,7 +138,12 @@ export async function setup() {
137138
let decrypt = await decryptEnvelope(response.body, clientSecret)
138139
return decrypt.body.refresh_token;
139140
};
141+
}
140142

143+
export function handleSummary(data) {
144+
return {
145+
'summary.json': JSON.stringify(data),
146+
}
141147
}
142148

143149
// Scenarios

0 commit comments

Comments
 (0)