From edfd0f5bcc591dc20023a6f48c35f887fcb3555f Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 16 Feb 2017 13:38:39 -0800 Subject: [bin] prefix twitter's scripts with 'tw'. --- bin/build-twttr-tools | 33 --------------------------------- bin/get-hosts-from-job | 5 ----- bin/kestrel-active-queues | 25 ------------------------- bin/os-centos-7-report | 26 -------------------------- bin/tw-build | 33 +++++++++++++++++++++++++++++++++ bin/tw-get-hosts-from-job | 5 +++++ bin/tw-kestrel-active-queues | 25 +++++++++++++++++++++++++ bin/tw-os7-report | 26 ++++++++++++++++++++++++++ bin/tw-zk-delete-nodes | 12 ++++++++++++ bin/zk-delete-dark-nodes | 12 ------------ 10 files changed, 101 insertions(+), 101 deletions(-) delete mode 100755 bin/build-twttr-tools delete mode 100755 bin/get-hosts-from-job delete mode 100755 bin/kestrel-active-queues delete mode 100755 bin/os-centos-7-report create mode 100755 bin/tw-build create mode 100755 bin/tw-get-hosts-from-job create mode 100755 bin/tw-kestrel-active-queues create mode 100755 bin/tw-os7-report create mode 100755 bin/tw-zk-delete-nodes delete mode 100755 bin/zk-delete-dark-nodes (limited to 'bin') diff --git a/bin/build-twttr-tools b/bin/build-twttr-tools deleted file mode 100755 index da54fe5..0000000 --- a/bin/build-twttr-tools +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -SOURCE_ROOT="${HOME}/src/source" - -if [ ! -d "${SOURCE_ROOT}" ]; then - echo "It looks like ${SOURCE_ROOT} is not available." - exit 1 -fi - -TARGETS=( - 'src/python/twitter/checkstyle:check' - 'src/python/twitter/messaging/julep/:julep' - 'src/python/twitter/messaging/oncall/:oncall' - 'src/python/twitter/messaging/tools/:bookkeeper' - 'src/python/twitter/messaging/tools/:bookkeeper-rereplicator' - 'src/python/twitter/messaging/tools/:customers-requests' - 'src/python/twitter/messaging/tools/:host-status' - 'src/python/twitter/messaging/tools/:msg-config' - 'src/python/twitter/messaging/tools/:partition-ownership' - 'src/python/twitter/messaging/tools/:proxy-admin' - 'src/python/twitter/messaging/xdc_replicator_check/:streams-to-replicate' - 'src/python/twitter/ops/mesos/bin/:mesosops' -) - -cd "${SOURCE_ROOT}" - -for target in "${TARGETS[@]}"; do - echo -n "Build $target" - ./pants -q binary "${target}" -done - -echo "Done." - diff --git a/bin/get-hosts-from-job b/bin/get-hosts-from-job deleted file mode 100755 index 6985bb6..0000000 --- a/bin/get-hosts-from-job +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -JOB_NAME=$1 - -aurora job status "${JOB_NAME}" |grep 'RUNNING on'|awk '{print $13}' | sort diff --git a/bin/kestrel-active-queues b/bin/kestrel-active-queues deleted file mode 100755 index 9cf85ce..0000000 --- a/bin/kestrel-active-queues +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -CLUSTER="${1:-kestrel.prod.low_sla}" - -for zone in atla smf1; do - echo "querying $zone/$CLUSTER" - - tmpfile=$(mktemp "/tmp/${CLUSTER}-${zone}.XXXXXX") - csvout="$(dirname $0)/${CLUSTER}-${zone}.csv" - - # first filter the metrics we want - cql -z "${zone}" k "${CLUSTER}" "sd.${CLUSTER}" | grep -e 'get_items_hit' > "${tmpfile}" - - # remove the csv output file if it exists - [ -e "${csvout}" ] && rm "${csvout}" - - # then we build the csv - for queue in $(cat "${tmpfile}"); do - total_hits=$(cql -z "${zone}" q -d 86400 "sum(default(0, rate(ts(sum, ${CLUSTER}, members(sd.${CLUSTER}), ${queue}))))"|awk '{sum+=$8} END{print sum}') - queue_name=$(echo ${queue} | sed -e 's/^q\/\(.*\)\/.*$/\1/') - echo "${queue_name};${total_hits}" >> "${csvout}" - done - - rm "${tmpfile}" -done diff --git a/bin/os-centos-7-report b/bin/os-centos-7-report deleted file mode 100755 index c003136..0000000 --- a/bin/os-centos-7-report +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -if [ ! hash osrpeort.pex 2>/dev/null ]; then - pushd . - cd "${HOME}/src/source" - ./pants binary src/python/twitter/corestorage/osreport - popd -fi - -ROLES=( - blobstore.prod.queue - deferredrpc - deferredrpc.staging - hosebird-kestrel - ibis.kestrel - kestrel - kestrel-low_sla - messaging.prod.bookkeeper - messaging.prod.distributedlog - rosette.kafka.prod - search-kestrel -) - -for role in ${ROLES[@]}; do - osreport.pex report ${role} -done diff --git a/bin/tw-build b/bin/tw-build new file mode 100755 index 0000000..da54fe5 --- /dev/null +++ b/bin/tw-build @@ -0,0 +1,33 @@ +#!/bin/bash + +SOURCE_ROOT="${HOME}/src/source" + +if [ ! -d "${SOURCE_ROOT}" ]; then + echo "It looks like ${SOURCE_ROOT} is not available." + exit 1 +fi + +TARGETS=( + 'src/python/twitter/checkstyle:check' + 'src/python/twitter/messaging/julep/:julep' + 'src/python/twitter/messaging/oncall/:oncall' + 'src/python/twitter/messaging/tools/:bookkeeper' + 'src/python/twitter/messaging/tools/:bookkeeper-rereplicator' + 'src/python/twitter/messaging/tools/:customers-requests' + 'src/python/twitter/messaging/tools/:host-status' + 'src/python/twitter/messaging/tools/:msg-config' + 'src/python/twitter/messaging/tools/:partition-ownership' + 'src/python/twitter/messaging/tools/:proxy-admin' + 'src/python/twitter/messaging/xdc_replicator_check/:streams-to-replicate' + 'src/python/twitter/ops/mesos/bin/:mesosops' +) + +cd "${SOURCE_ROOT}" + +for target in "${TARGETS[@]}"; do + echo -n "Build $target" + ./pants -q binary "${target}" +done + +echo "Done." + diff --git a/bin/tw-get-hosts-from-job b/bin/tw-get-hosts-from-job new file mode 100755 index 0000000..6985bb6 --- /dev/null +++ b/bin/tw-get-hosts-from-job @@ -0,0 +1,5 @@ +#!/bin/bash + +JOB_NAME=$1 + +aurora job status "${JOB_NAME}" |grep 'RUNNING on'|awk '{print $13}' | sort diff --git a/bin/tw-kestrel-active-queues b/bin/tw-kestrel-active-queues new file mode 100755 index 0000000..9cf85ce --- /dev/null +++ b/bin/tw-kestrel-active-queues @@ -0,0 +1,25 @@ +#!/bin/bash + +CLUSTER="${1:-kestrel.prod.low_sla}" + +for zone in atla smf1; do + echo "querying $zone/$CLUSTER" + + tmpfile=$(mktemp "/tmp/${CLUSTER}-${zone}.XXXXXX") + csvout="$(dirname $0)/${CLUSTER}-${zone}.csv" + + # first filter the metrics we want + cql -z "${zone}" k "${CLUSTER}" "sd.${CLUSTER}" | grep -e 'get_items_hit' > "${tmpfile}" + + # remove the csv output file if it exists + [ -e "${csvout}" ] && rm "${csvout}" + + # then we build the csv + for queue in $(cat "${tmpfile}"); do + total_hits=$(cql -z "${zone}" q -d 86400 "sum(default(0, rate(ts(sum, ${CLUSTER}, members(sd.${CLUSTER}), ${queue}))))"|awk '{sum+=$8} END{print sum}') + queue_name=$(echo ${queue} | sed -e 's/^q\/\(.*\)\/.*$/\1/') + echo "${queue_name};${total_hits}" >> "${csvout}" + done + + rm "${tmpfile}" +done diff --git a/bin/tw-os7-report b/bin/tw-os7-report new file mode 100755 index 0000000..c003136 --- /dev/null +++ b/bin/tw-os7-report @@ -0,0 +1,26 @@ +#!/bin/bash + +if [ ! hash osrpeort.pex 2>/dev/null ]; then + pushd . + cd "${HOME}/src/source" + ./pants binary src/python/twitter/corestorage/osreport + popd +fi + +ROLES=( + blobstore.prod.queue + deferredrpc + deferredrpc.staging + hosebird-kestrel + ibis.kestrel + kestrel + kestrel-low_sla + messaging.prod.bookkeeper + messaging.prod.distributedlog + rosette.kafka.prod + search-kestrel +) + +for role in ${ROLES[@]}; do + osreport.pex report ${role} +done diff --git a/bin/tw-zk-delete-nodes b/bin/tw-zk-delete-nodes new file mode 100755 index 0000000..b5e995e --- /dev/null +++ b/bin/tw-zk-delete-nodes @@ -0,0 +1,12 @@ +#!/bin/bash + +set -x +set -e + +members=$(echo "ls /messaging/distributedlog/EventBus/" | zk-shell msgzookeeper.atla.twitter.com --run-from-stdin) + +for m in $members; do + if [[ $m =~ ^eventbus_system_loadtest_8_ ]]; then + echo "rmr /messaging/distributedlog/EventBus/$m" | zk-shell msgzookeeper.atla.twitter.com --run-from-stdin + fi +done diff --git a/bin/zk-delete-dark-nodes b/bin/zk-delete-dark-nodes deleted file mode 100755 index b5e995e..0000000 --- a/bin/zk-delete-dark-nodes +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -set -x -set -e - -members=$(echo "ls /messaging/distributedlog/EventBus/" | zk-shell msgzookeeper.atla.twitter.com --run-from-stdin) - -for m in $members; do - if [[ $m =~ ^eventbus_system_loadtest_8_ ]]; then - echo "rmr /messaging/distributedlog/EventBus/$m" | zk-shell msgzookeeper.atla.twitter.com --run-from-stdin - fi -done -- cgit 1.4.1