refactor graphite stanzas for readability

this refactors the graphite stanzas to something that's more
readable, and makes it simpler to add new ones later without
lots of copy / paste.

Change-Id: I077d54ce885ba3bbcc0ceca4f05959f508a88e96
This commit is contained in:
Sean Dague 2013-12-11 09:19:47 -05:00
parent 98bd8da825
commit 8e68f222cc
2 changed files with 15 additions and 24 deletions

View File

@ -12,6 +12,15 @@
// License for the specific language governing permissions and limitations
// under the License.
function graphite_moving_avg(job, color) {
var time = '5hours';
var graph = "color(alias(movingAverage(asPercent(";
graph += "stats.zuul.pipeline.gate.job." + job + ".FAILURE,";
graph += "sum(stats.zuul.pipeline.gate.job." + job + ".{SUCCESS,FAILURE})";
graph += "),'" + time + "'), '" + job + "'),'" + color + "')";
return graph;
}
function update() {
$.getJSON('http://status.openstack.org/elastic-recheck/data/graph.json', function(data) {
var seen = [];

View File

@ -77,30 +77,12 @@ $("#graph-container").append($(new Image()).graphite({
yMax: 100,
yMin: 0,
target: [
"color(alias(movingAverage(asPercent(\
stats.zuul.pipeline.gate.job.gate-tempest-dsvm-neutron.FAILURE,\
sum(stats.zuul.pipeline.gate.job.gate-tempest-dsvm-neutron.{SUCCESS,FAILURE})\
),'5hours'), 'gate-tempest-dsvm-neutron'),'00c868')",
"color(alias(movingAverage(asPercent(\
stats.zuul.pipeline.gate.job.gate-tempest-dsvm-full.FAILURE,\
sum(stats.zuul.pipeline.gate.job.gate-tempest-dsvm-full.{SUCCESS,FAILURE})\
),'5hours'), 'gate-tempest-dsvm-full'),'00FF00')",
"color(alias(movingAverage(asPercent(\
stats.zuul.pipeline.gate.job.gate-grenade-dsvm.FAILURE,\
sum(stats.zuul.pipeline.gate.job.gate-grenade-dsvm.{SUCCESS,FAILURE})\
),'5hours'), 'gate-grenade-dsvm'),'800080')",
"color(alias(movingAverage(asPercent(\
stats.zuul.pipeline.gate.job.gate-tempest-dsvm-large-ops.FAILURE,\
sum(stats.zuul.pipeline.gate.job.gate-tempest-dsvm-large-ops.{SUCCESS,FAILURE})\
),'5hours'), 'gate-tempest-dsvm-large-ops'),'00F0F0')",
"color(alias(movingAverage(asPercent(\
stats.zuul.pipeline.gate.job.gate-tempest-dsvm-neutron-large-ops.FAILURE,\
sum(stats.zuul.pipeline.gate.job.gate-tempest-dsvm-neutron-large-ops.{SUCCESS,FAILURE})\
),'5hours'), 'gate-tempest-dsvm-neutron-large-ops'),'E080FF')",
"color(alias(movingAverage(asPercent(\
stats.zuul.pipeline.gate.job.gate-tempest-dsvm-postgres-full.FAILURE,\
sum(stats.zuul.pipeline.gate.job.gate-tempest-dsvm-postgres-full.{SUCCESS,FAILURE})\
),'5hours'), 'gate-tempest-dsvm-postgres-full'),'ED9121')",
graphite_moving_avg("gate-tempest-dsvm-neutron", "00c868"),
graphite_moving_avg("gate-tempest-dsvm-full","00FF00"),
graphite_moving_avg("gate-grenade-dsvm","800080"),
graphite_moving_avg("gate-tempest-dsvm-large-ops","00F0F0"),
graphite_moving_avg("gate-tempest-dsvm-neutron-large-ops","E080FF"),
graphite_moving_avg("gate-tempest-dsvm-postgres-full","ED9121")
],
title: "Gate Failure Rates"
}));