From 13bf7c47c80c368a078047111a612500d2ae5519 Mon Sep 17 00:00:00 2001 From: Gregory Meno Date: Wed, 19 Apr 2017 16:46:49 -0700 Subject: [PATCH] adds a simple script that feeds bz counts into grafana Signed-off-by: Gregory Meno --- bz-mill/build/build | 17 +++++++++++++++++ bz-mill/build/teardown | 13 +++++++++++++ bz-mill/config/definitions/bz-mill.yml | 5 +++++ .../config/definitions/map_namespace_to_query | 2 ++ 4 files changed, 37 insertions(+) create mode 100755 bz-mill/build/build create mode 100644 bz-mill/build/teardown create mode 100644 bz-mill/config/definitions/bz-mill.yml create mode 100644 bz-mill/config/definitions/map_namespace_to_query diff --git a/bz-mill/build/build b/bz-mill/build/build new file mode 100755 index 00000000..7b9b9826 --- /dev/null +++ b/bz-mill/build/build @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e + +cat config/definitions/map_namespace_to_query |\ +while read url namespace; +do + echo "$url ::: $namespace"; + bz_count=$(curl 2>/dev/null -XGET -L "$url" 3>/dev/null | sed 1d | tr "," " " | awk '{print $1}' | sort -n | wc -l); + echo "$namespace $bz_count $(date +%s)"; + echo "$namespace $bz_count $(date +%s)" | nc grafana.ceph.com 2003 +done +#we'll eventually want to just iterate a list of BZ query URLs +#url=http://red.ht/2paAywM +#TODO auth against BZ so we get counts of hidden BZs + +#namespace="bz.gmeno.ceph.any.needinfo.24hrs" diff --git a/bz-mill/build/teardown b/bz-mill/build/teardown new file mode 100644 index 00000000..5790664a --- /dev/null +++ b/bz-mill/build/teardown @@ -0,0 +1,13 @@ +#!/bin/bash +# There has to be a better way to do this than this script which just looks +# for every Vagrantfile in scenarios and then just destroys whatever is left. + +cd $WORKSPACE/ceph-ansible/tests/functional + +scenarios=$(find . | grep Vagrantfile | xargs dirname) + +for scenario in $scenarios; do + cd $scenario + vagrant destroy -f + cd - +done diff --git a/bz-mill/config/definitions/bz-mill.yml b/bz-mill/config/definitions/bz-mill.yml new file mode 100644 index 00000000..acbde4fd --- /dev/null +++ b/bz-mill/config/definitions/bz-mill.yml @@ -0,0 +1,5 @@ +- project: + name: bz-mill + + triggers: + - timed: '@hourly' diff --git a/bz-mill/config/definitions/map_namespace_to_query b/bz-mill/config/definitions/map_namespace_to_query new file mode 100644 index 00000000..7ff8d6b8 --- /dev/null +++ b/bz-mill/config/definitions/map_namespace_to_query @@ -0,0 +1,2 @@ +http://red.ht/2oiunCH bz.gmeno.ceph.new.customer.24hrs +http://red.ht/2paAywM bz.gmeno.ceph.any.needinfo.24hrs -- 2.39.5