Skip to content

Commit

Permalink
Make change and trend thresholds configurable in settings.py
Browse files Browse the repository at this point in the history
Comparison view: Don't render legend off plot area when there is only one bar
  • Loading branch information
tobami committed Jan 11, 2011
1 parent b8fa0bf commit 83aae3c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions speedcenter/codespeed/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
# Given as the name of the executable and commitid of the revision
# Example: defaultbaseline = {'executable': 'myexe', 'revision': '21'}

# Threshold that determines when a performance change over the last result is significant
changethreshold = 3.0

# Threshold that determines when a performance change
# over a number of revisions is significant
trendthreshold = 3.0

# Changes view options ##
defaultexecutable = None # Executable that should be chosen as default in the changes view
# Given as the id of the executable.
Expand Down
5 changes: 5 additions & 0 deletions speedcenter/codespeed/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,11 @@ def changes(request):
# Configuration of default parameters
defaultchangethres = 3
defaulttrendthres = 3
if hasattr(settings, 'changethreshold') and settings.changethreshold != None:
defaultchangethres = settings.changethreshold
if hasattr(settings, 'trendthreshold') and settings.trendthreshold != None:
defaulttrendthres = settings.trendthreshold

defaulttrend = 10
trends = [5, 10, 20, 50, 100]
if 'tre' in data and int(data['tre']) in trends:
Expand Down
2 changes: 1 addition & 1 deletion speedcenter/media/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ div#contentwrap div div { display: block; }
@media only screen and (max-width:1010px) {
div#contentwrap div { display: table-row!important; }
table.info { margin-bottom: 0.8em; }
div#title { margin-bottom: -37px; background-color: transparent; }
div#title { margin-bottom: -35px; background-color: transparent; }
div#title h2 { margin-top: 0.1em; margin-right: 2px; font-size: 90%; float: none; }
div#title ul {
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion speedcenter/media/js/codespeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function renderComparisonPlot(plotid, benchmarks, exes, enviros, baseline, chart

// determine conditions for rendering the legend outside the plot area
var offplot = false;
if (!horizontal && (series.length > 4 || ticks.length == 1)) { offplot = true; }
if (!horizontal && series.length > 4) { offplot = true; }
else if (horizontal && series.length > 2*ticks.length) { offplot = true; }

if (offplot) {
Expand Down

0 comments on commit 83aae3c

Please sign in to comment.