This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws s3 cp s3://$SCENARIOS_BUCKET/$SERVICE . --recursive | |
# Default environment variables | |
TASK_COUNT=10 | |
source ./overwrites.env # Override TASK_COUNT & others if needed | |
./setup.sh && echo "Setup script finished." || echo "No setup.sh file found. Continuing..." | |
PAYLOAD=$( jq -n -c \ | |
--arg tc "$TASK_COUNT" \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws s3 cp --recursive s3://$SCENARIOS_S3_BUCKET/$SERVICE/ . | |
source overwrites.env | |
npx artillery run --config config.yaml -e $ENVIRONMENT spec.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config: | |
environments: | |
# Configure several environments and select which to run through the -e flag | |
local: | |
target: "http://localhost:8080" | |
preproduction: | |
target: "https://example-api.preproduction.mycorp.internal" | |
phases: | |
- duration: 120 | |
arrivalRate: 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scenarios: | |
# Each virtual user created by Artillery will run one of the scenarios, | |
# randomly choosing one based on the weight attribute | |
- name: "Add song to an existing collection" | |
weight: 5 | |
flow: | |
- get: | |
# Defined on ./helpers.js, sets env specific auth headers | |
beforeRequest: "setAuthorizationHeaders" | |
url: "/v1/collections" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.istio.io/v1alpha3 | |
kind: DestinationRule | |
metadata: | |
name: reviews-destination | |
spec: | |
host: reviews | |
subsets: | |
- name: v1 | |
labels: | |
version: v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
retries: | |
attempts: 3 | |
perTryTimeout: 2s | |
retryOn: gateway-error,connect-failure,refused-stream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.istio.io/v1alpha3 | |
kind: VirtualService | |
metadata: | |
name: reviews | |
spec: | |
hosts: | |
- reviews | |
http: | |
- route: | |
- destination: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
spec: | |
containers: | |
- name: ratings | |
image: istio/examples-bookinfo-ratings-v1:1.14.0 | |
imagePullPolicy: IfNotPresent | |
ports: | |
- containerPort: 9080 | |
env: | |
- name: SERVICE_VERSION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (process.env.SERVICE_VERSION === 'v-faulty') { | |
if (Math.random() <= 0.5) // Break in half the calls | |
return getLocalReviewsServiceUnavailable(res) | |
return getLocalReviewsSuccessful(res, productId) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: networking.istio.io/v1alpha3 | |
kind: VirtualService | |
metadata: | |
name: reviews | |
spec: | |
hosts: | |
- reviews | |
http: | |
- route: | |
- destination: |
NewerOlder