diff options
author | Franck Cuny <fcuny@twitter.com> | 2018-11-23 09:27:06 -0800 |
---|---|---|
committer | Franck Cuny <fcuny@twitter.com> | 2018-11-23 09:27:06 -0800 |
commit | 4492c5cfbe0e99666afed6780b674beaa670d1a1 (patch) | |
tree | 0b60557a2640f364ddeef4cbca9d72b2358e618b /scripts | |
parent | [tmux] Small change to binding + fix terminal (diff) | |
download | emacs.d-4492c5cfbe0e99666afed6780b674beaa670d1a1.tar.gz |
[bash] Let's try to use emacs tty
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/cqlmetrics | 11 | ||||
-rwxr-xr-x | scripts/cqlq | 17 |
2 files changed, 28 insertions, 0 deletions
diff --git a/scripts/cqlmetrics b/scripts/cqlmetrics new file mode 100755 index 0000000..db3db6a --- /dev/null +++ b/scripts/cqlmetrics @@ -0,0 +1,11 @@ +#!/bin/bash + +service=$1 + +if [ -z "${service}" ]; then + exit 1 +fi + +zone="${2:-smf1}" + +echo $(cql -z "${zone}" k "${service}" "sd.${service}" | fzf) diff --git a/scripts/cqlq b/scripts/cqlq new file mode 100755 index 0000000..bf47c50 --- /dev/null +++ b/scripts/cqlq @@ -0,0 +1,17 @@ +#!/bin/bash + +service=$1 +if [ -z "${service}" ]; then + exit 1 +fi + +zone="${2:-smf1}" + +metric=$(cqlmetrics "${service}" "${zone}") + +query="zone(${zone}, ts(${service}, members(sd.${service}), ${metric}))" + +short_id=$(curl -s --negotiate -u : -X POST https://monitoring.twitter.biz/api/2/url/shortener --data "{\"longUrl\":\"/query?&queries=%5B%7B%22id%22%3A%22query-1%22%2C%22name%22%3A%22Query%201%22%2C%22query%22%3A%22$query%22%2C%22settings%22%3A%7B%22visible%22%3Atrue%7D%7D%5D\"}" | jq '.id') + +echo "http://monitoring.twitter.biz/tiny/${short_id}" +open "http://monitoring.twitter.biz/tiny/${short_id}" |