Skip to content

Commit

Permalink
Modify scipts for identity map only
Browse files Browse the repository at this point in the history
  • Loading branch information
cYKatherine committed Feb 24, 2025
1 parent 9f0a399 commit c1d9eb4
Showing 1 changed file with 77 additions and 71 deletions.
148 changes: 77 additions & 71 deletions performance-testing/uid2-operator/k6-uid2-operator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import encoding from 'k6/encoding';
import {check} from 'k6';
import http from 'k6/http';

const testDurationInSeconds = 2500;
const tokenGenerateTests = true;
const tokenRefreshTests = true;
const testDurationInSeconds = 5000;
const tokenGenerateTests = false;
const tokenRefreshTests = false;
const identityMapTests = true;
const identityBucketTests = true;
const identityBucketTests = false;
const identityMapVus = 10;
const identityMapDuration = '30s';


//30 warm up on each
Expand All @@ -20,83 +22,83 @@ export const options = {
noConnectionReuse: true,
scenarios: {
// Warmup scenarios
tokenGenerateWarmup: {
executor: 'constant-vus',
exec: 'tokenGenerate',
vus: 300,
duration: '30s',
gracefulStop: '0s',
},
tokenRefreshWarmup: {
executor: 'constant-vus',
exec: 'tokenRefresh',
vus: 300,
duration: '30s',
gracefulStop: '0s',
},
// tokenGenerateWarmup: {
// executor: 'constant-vus',
// exec: 'tokenGenerate',
// vus: 300,
// duration: '30s',
// gracefulStop: '0s',
// },
// tokenRefreshWarmup: {
// executor: 'constant-vus',
// exec: 'tokenRefresh',
// vus: 300,
// duration: '30s',
// gracefulStop: '0s',
// },
identityMapWarmup: {
executor: 'constant-vus',
exec: 'identityMap',
vus: 300,
duration: '30s',
gracefulStop: '0s',
},
identityBucketsWarmup: {
executor: 'constant-vus',
exec: 'identityBuckets',
vus: 2,
duration: '30s',
gracefulStop: '0s',
},
// identityBucketsWarmup: {
// executor: 'constant-vus',
// exec: 'identityBuckets',
// vus: 2,
// duration: '30s',
// gracefulStop: '0s',
// },
// Actual testing scenarios
tokenGenerate: {
executor: 'constant-vus',
exec: 'tokenGenerate',
vus: 300,
duration: '300s',
gracefulStop: '0s',
startTime: '40s',
},
tokenRefresh: {
executor: 'constant-vus',
exec: 'tokenRefresh',
vus: 300,
duration: '300s',
gracefulStop: '0s',
startTime: '350s',
},
identityMap: {
executor: 'constant-vus',
exec: 'identityMap',
vus: 300,
duration: '300s',
gracefulStop: '0s',
startTime: '660s',
},
identityMapLargeBatchSequential: {
executor: 'constant-vus',
exec: 'identityMapLargeBatch',
vus: 1,
duration: '300s',
gracefulStop: '0s',
startTime: '970s',
},
// tokenGenerate: {
// executor: 'constant-vus',
// exec: 'tokenGenerate',
// vus: 300,
// duration: '300s',
// gracefulStop: '0s',
// startTime: '40s',
// },
// tokenRefresh: {
// executor: 'constant-vus',
// exec: 'tokenRefresh',
// vus: 300,
// duration: '300s',
// gracefulStop: '0s',
// startTime: '350s',
// },
// identityMap: {
// executor: 'constant-vus',
// exec: 'identityMap',
// vus: 300,
// duration: '300s',
// gracefulStop: '0s',
// startTime: '660s',
// },
// identityMapLargeBatchSequential: {
// executor: 'constant-vus',
// exec: 'identityMapLargeBatch',
// vus: 1,
// duration: '300s',
// gracefulStop: '0s',
// startTime: '970s',
// },
identityMapLargeBatch: {
executor: 'constant-vus',
exec: 'identityMapLargeBatch',
vus: 16,
duration: '300s',
vus: identityMapVus,
duration: identityMapDuration,
gracefulStop: '0s',
startTime: '1280s',
},
identityBuckets: {
executor: 'constant-vus',
exec: 'identityBuckets',
vus: 2,
duration: '300s',
gracefulStop: '0s',
startTime: '1590s',
startTime: '40s',
},
// identityBuckets: {
// executor: 'constant-vus',
// exec: 'identityBuckets',
// vus: 2,
// duration: '300s',
// gracefulStop: '0s',
// startTime: '1590s',
// },
},
// So we get count in the summary, to demonstrate different metrics are different
summaryTrendStats: ['avg', 'min', 'med', 'max', 'p(90)', 'p(95)', 'p(99)', 'count'],
Expand All @@ -120,9 +122,13 @@ for (let key in options.scenarios) {
}

// Configs
const clientSecret = __ENV.CLIENT_SECRET;
const clientKey = __ENV.CLIENT_KEY;
const baseUrl = __ENV.BASE_URL;
// const clientSecret = __ENV.CLIENT_SECRET;
// const clientKey = __ENV.CLIENT_KEY;
// const baseUrl = __ENV.BASE_URL;

const baseUrl = "http://74.179.232.150";
const clientSecret = "s4BIdGNBAV/0FwhmErysepqsdmdQw1NH4g1XoX06uzM=";
const clientKey = "UID2-C-I-32-N8gkyF.wWk2Ju78z+fLmC9mZ0xvgSrXjQkGHHgFgkUvk=";

Check failure

Code scanning / Trivy

UID2 - Client Key - Integ Critical

Artifact: performance-testing/uid2-operator/k6-uid2-operator.js
Type:
Secret UID2 - Client Key - Integ
Severity: CRITICAL
Match: const clientKey = "UID2-C-I-32-*********************************************";

export async function setup() {
// pregenerate the envelopes so they don't expire, but can be reused. Means the load test is not constrained by the client
Expand Down

0 comments on commit c1d9eb4

Please sign in to comment.