OLD | NEW |
---|---|
(Empty) | |
1 #!/bin/bash | |
2 # Run this script from its directory, to correctly pick up loadtest_startup.sh: | |
ghost stip (do not use)
2015/04/14 00:36:43
might be a good idea to move all the loadtest scri
| |
3 # cd scripts | |
4 # ./loadtest_setup.sh | |
5 | |
6 PROJECT="chrome-infra-mon-proxy" | |
7 # Use a non-US zone to save the US quota. | |
8 REGION="asia-east1" | |
9 ZONE_ASIA="asia-east1-b" | |
10 ZONE_US="us-central2-a" | |
11 ZONE_EU="europe-west1-d" | |
12 LOADTEST_INSTANCES_ASIA=20 | |
13 LOADTEST_INSTANCES_US=20 | |
14 LOADTEST_INSTANCES_EU=10 | |
15 | |
16 function delete_instance { | |
17 # delete_instance zone instance-name | |
18 echo delete instance $2 in zone $1 | |
19 gcloud compute -q --project "$PROJECT" instances delete "$2" --zone "$1" & | |
20 } | |
21 | |
22 function create_instance { | |
23 # create_instance zone instance_name | |
24 echo create instance $2 in zone $1 | |
25 gcloud compute -q --project "$PROJECT" instances create $2 --project "$PROJE CT" --machine-type n1-standard-1 --zone "$1" --image container-vm --network defa ult --metadata-from-file google-container-manifest=loadtest_containers.yaml star tup-script=loadtest_startup.sh & | |
26 } | |
27 | |
28 function delete_instance_asia { | |
29 delete_instance "$ZONE_ASIA" "loadtest-asia$1" | |
30 } | |
31 | |
32 function delete_instance_us { | |
33 delete_instance "$ZONE_US" "loadtest-us$1" | |
34 } | |
35 | |
36 function delete_instance_eu { | |
37 delete_instance "$ZONE_EU" "loadtest-eu$1" | |
38 } | |
39 | |
40 function create_instance_asia { | |
41 create_instance "$ZONE_ASIA" "loadtest-asia$1" | |
42 } | |
43 | |
44 function create_instance_us { | |
45 create_instance "$ZONE_US" "loadtest-us$1" | |
46 } | |
47 | |
48 function create_instance_eu { | |
49 create_instance "$ZONE_EU" "loadtest-eu$1" | |
50 } | |
51 | |
52 # Destroy load test instances. Make sure you've listed them all. | |
53 if false; then | |
54 for i in $(seq 1 $LOADTEST_INSTANCES_ASIA); do | |
55 delete_instance_asia "$i" | |
56 done | |
57 for i in $(seq 1 $LOADTEST_INSTANCES_US); do | |
58 delete_instance_us "$i" | |
59 done | |
60 for i in $(seq 1 $LOADTEST_INSTANCES_EU); do | |
61 delete_instance_eu "$i" | |
62 done | |
63 fi | |
64 | |
65 # Spin up load test instances. Add as many as you need. | |
66 if false; then | |
67 for i in $(seq 1 $LOADTEST_INSTANCES_ASIA); do | |
68 create_instance_asia "$i" | |
69 done | |
70 for i in $(seq 1 $LOADTEST_INSTANCES_US); do | |
71 create_instance_us "$i" | |
72 done | |
73 for i in $(seq 1 $LOADTEST_INSTANCES_EU); do | |
74 create_instance_eu "$i" | |
75 done | |
76 fi | |
77 | |
OLD | NEW |