Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1896)

Unified Diff: appengine/chrome_infra_mon_proxy/scripts/loadtest_setup.sh

Issue 928043005: Monitoring proxy for time series data (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: More fine-tuning Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/chrome_infra_mon_proxy/scripts/loadtest_setup.sh
diff --git a/appengine/chrome_infra_mon_proxy/scripts/loadtest_setup.sh b/appengine/chrome_infra_mon_proxy/scripts/loadtest_setup.sh
new file mode 100755
index 0000000000000000000000000000000000000000..297087e07477c01439d220ab35ee383bdd8430c3
--- /dev/null
+++ b/appengine/chrome_infra_mon_proxy/scripts/loadtest_setup.sh
@@ -0,0 +1,77 @@
+#!/bin/bash
+# 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
+# cd scripts
+# ./loadtest_setup.sh
+
+PROJECT="chrome-infra-mon-proxy"
+# Use a non-US zone to save the US quota.
+REGION="asia-east1"
+ZONE_ASIA="asia-east1-b"
+ZONE_US="us-central2-a"
+ZONE_EU="europe-west1-d"
+LOADTEST_INSTANCES_ASIA=20
+LOADTEST_INSTANCES_US=20
+LOADTEST_INSTANCES_EU=10
+
+function delete_instance {
+ # delete_instance zone instance-name
+ echo delete instance $2 in zone $1
+ gcloud compute -q --project "$PROJECT" instances delete "$2" --zone "$1" &
+}
+
+function create_instance {
+ # create_instance zone instance_name
+ echo create instance $2 in zone $1
+ gcloud compute -q --project "$PROJECT" instances create $2 --project "$PROJECT" --machine-type n1-standard-1 --zone "$1" --image container-vm --network default --metadata-from-file google-container-manifest=loadtest_containers.yaml startup-script=loadtest_startup.sh &
+}
+
+function delete_instance_asia {
+ delete_instance "$ZONE_ASIA" "loadtest-asia$1"
+}
+
+function delete_instance_us {
+ delete_instance "$ZONE_US" "loadtest-us$1"
+}
+
+function delete_instance_eu {
+ delete_instance "$ZONE_EU" "loadtest-eu$1"
+}
+
+function create_instance_asia {
+ create_instance "$ZONE_ASIA" "loadtest-asia$1"
+}
+
+function create_instance_us {
+ create_instance "$ZONE_US" "loadtest-us$1"
+}
+
+function create_instance_eu {
+ create_instance "$ZONE_EU" "loadtest-eu$1"
+}
+
+# Destroy load test instances. Make sure you've listed them all.
+if false; then
+ for i in $(seq 1 $LOADTEST_INSTANCES_ASIA); do
+ delete_instance_asia "$i"
+ done
+ for i in $(seq 1 $LOADTEST_INSTANCES_US); do
+ delete_instance_us "$i"
+ done
+ for i in $(seq 1 $LOADTEST_INSTANCES_EU); do
+ delete_instance_eu "$i"
+ done
+fi
+
+# Spin up load test instances. Add as many as you need.
+if false; then
+ for i in $(seq 1 $LOADTEST_INSTANCES_ASIA); do
+ create_instance_asia "$i"
+ done
+ for i in $(seq 1 $LOADTEST_INSTANCES_US); do
+ create_instance_us "$i"
+ done
+ for i in $(seq 1 $LOADTEST_INSTANCES_EU); do
+ create_instance_eu "$i"
+ done
+fi
+

Powered by Google App Engine
This is Rietveld 408576698