Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add in thresholds #13

Merged
merged 1 commit into from

1 participant

@andymckay
Owner

No description provided.

@andymckay andymckay merged commit 50ca06b into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 2, 2014
  1. @andymckay

    add in thresholds

    andymckay authored
This page is out of date. Refresh to see the latest.
View
12 zamboni_dashboard/templates/graphite.html
@@ -13,10 +13,10 @@
{% endfor %}
</p>
<h2><a id="{{ graph.slug }}">{{ graph.name }}</a></h2>
- <img class="fifteen" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ fifteen }}">
- <img class="hour" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ hour }}">
- <img class="day" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ day }}">
- <img class="week" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ week }}">
- <img class="month" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ month }}">
- <img class="3month" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ three_month }}">
+ <img class="fifteen" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ fifteen }}{{ thresholds }}"">
+ <img class="hour" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ hour }}{{ thresholds }}"">
+ <img class="day" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ day }}{{ thresholds }}"">
+ <img class="week" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ week }}{{ thresholds }}">
+ <img class="month" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ month }}{{ thresholds }}"">
+ <img class="3month" src="{{ base }}&amp;{{ graph.url[0] }}{{ graph.updates }}&amp;{{ three_month }}{{ thresholds }}"">
{% endblock %}
View
5 zamboni_dashboard/views.py
@@ -61,6 +61,7 @@ def get_graphite_data(site):
'ns': 'stats.%s' % app.config['GRAPHITE_SITES'][site]
}
+
def get_template_data(source, data, graph, site):
graphs = {}
for name, gs in source:
@@ -98,6 +99,10 @@ def graphite_api():
'marketplace-stage': 'marketplace-stage',
}
template_data = get_template_data(graphite_api_graphs, data, graph, site)
+ # This only goes halfway across, we need a graphite update
+ # for more. https://bugs.launchpad.net/graphite/+bug/1013308
+ template_data['thresholds'] = ('&target=threshold(500, "poor", orange)'
+ '&target=threshold(1000, "bad", red)')
return render_template('graphite.html', **template_data)
Something went wrong with that request. Please try again.