Skip to content

Commit accf33f

Browse files
committed
Update Traffic Generator to remove canary type logic
1 parent 827ac08 commit accf33f

File tree

2 files changed

+5
-24
lines changed

2 files changed

+5
-24
lines changed

.github/workflows/traffic-generator-image-build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ name: Create and Push Traffic Generator
55
on:
66
workflow_dispatch:
77
push:
8-
branches:
9-
- main
10-
paths:
11-
- 'sample-apps/traffic-generator/**'
8+
# branches:
9+
# - main
10+
# paths:
11+
# - 'sample-apps/traffic-generator/**'
1212

1313
permissions:
1414
id-token: write

sample-apps/traffic-generator/index.js

+1-20
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
2424

2525
// This loop will run until the environment variables are available
2626
const waitForEnvVariables = async () => {
27-
while (!process.env.MAIN_ENDPOINT || !process.env.REMOTE_ENDPOINT || !process.env.ID || !process.env.CANARY_TYPE) {
27+
while (!process.env.MAIN_ENDPOINT || !process.env.REMOTE_ENDPOINT || !process.env.ID) {
2828
console.log('Environment variables not set. Waiting for 10 seconds...');
2929
await sleep(10000); // Wait for 10 seconds
3030
}
@@ -37,7 +37,6 @@ const trafficGenerator = async (interval) => {
3737
const mainEndpoint = process.env.MAIN_ENDPOINT;
3838
const remoteEndpoint = process.env.REMOTE_ENDPOINT;
3939
const id = process.env.ID;
40-
const canaryType = process.env.CANARY_TYPE
4140

4241
let urls = [
4342
`http://${mainEndpoint}/outgoing-http-call`,
@@ -46,24 +45,6 @@ const trafficGenerator = async (interval) => {
4645
`http://${mainEndpoint}/client-call`
4746
];
4847

49-
if (canaryType === 'java-eks' || canaryType === 'python-eks') {
50-
urls.push(`http://${mainEndpoint}/mysql`)
51-
}
52-
53-
// Need to call some APIs so that it exceeds the metric limiter threshold and make the test
54-
// APIs generate AllOtherOperations metric. Sleep for a minute to let cloudwatch service process the API call
55-
// Calling it here before calling the remote sample app endpoint because the API generated by it is validated
56-
// for AllOtherRemoteOperations in the metric validation step
57-
if (canaryType === 'java-metric-limiter'){
58-
const fakeUrls = [
59-
`http://${mainEndpoint}`,
60-
`http://${mainEndpoint}/fake-endpoint`
61-
]
62-
// Send the fake requests and wait a minute
63-
await sendRequests(fakeUrls);
64-
await sleep(60000);
65-
}
66-
6748
await sendRequests(urls);
6849
setInterval(() => sendRequests(urls), interval);
6950
}

0 commit comments

Comments
 (0)