]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
adds a simple script that feeds bz counts into grafana
authorGregory Meno <gmeno@redhat.com>
Wed, 19 Apr 2017 23:46:49 +0000 (16:46 -0700)
committerGregory Meno <gmeno@redhat.com>
Wed, 19 Apr 2017 23:46:49 +0000 (16:46 -0700)
Signed-off-by: Gregory Meno <gmeno@redhat.com>
bz-mill/build/build [new file with mode: 0755]
bz-mill/build/teardown [new file with mode: 0644]
bz-mill/config/definitions/bz-mill.yml [new file with mode: 0644]
bz-mill/config/definitions/map_namespace_to_query [new file with mode: 0644]

diff --git a/bz-mill/build/build b/bz-mill/build/build
new file mode 100755 (executable)
index 0000000..7b9b982
--- /dev/null
@@ -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 (file)
index 0000000..5790664
--- /dev/null
@@ -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 (file)
index 0000000..acbde4f
--- /dev/null
@@ -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 (file)
index 0000000..7ff8d6b
--- /dev/null
@@ -0,0 +1,2 @@
+http://red.ht/2oiunCH bz.gmeno.ceph.new.customer.24hrs
+http://red.ht/2paAywM bz.gmeno.ceph.any.needinfo.24hrs