Skip to content

Commit a4919d4

Browse files
authored
Merge branch 'speed.pypy.org' into mercurial
2 parents 5e1bdae + 47c2062 commit a4919d4

27 files changed

Lines changed: 424 additions & 45 deletions

File tree

codespeed/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ def get_changes_table(self, trend_depth=10, force_save=False):
475475
val_max = "-"
476476

477477
# Calculate percentage change relative to previous result
478-
result = resobj.value
478+
result = max(resobj.value, 0)
479479
change = "-"
480480
if len(change_list):
481481
c = change_list.filter(benchmark=bench)

codespeed/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""Default settings for Codespeed"""
33

44
## General default options ##
5-
WEBSITE_NAME = "MySpeedSite" # This name will be used in the reports RSS feed
5+
WEBSITE_NAME = "PyPy's Speed Center" # This name will be used in the reports RSS feed
66

77
DEF_ENVIRONMENT = None # Name of the environment which should be selected as default
88

codespeed/static/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ div#presentation div.menubox {
119119
}
120120
div#presentation div.menubox:hover { border: 5px solid #FFCE9C; }
121121

122-
div#presentation p { height: 5em; padding-left: 120px; }
122+
div#presentation div.menubox p { height: 5em; padding-left: 120px; }
123123

124124
div#presentation div#changes p {
125125
background: url(../images/changes.png) no-repeat;
3.15 KB
Binary file not shown.

codespeed/static/js/jqplot/jqplot.pointLabels.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codespeed/views.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,20 @@ def gethistoricaldata(request):
9494
# Fetch Baseline data
9595
baseline_exe = Executable.objects.get(
9696
name=settings.DEF_BASELINE['executable'])
97-
baseline_lastrev = Revision.objects.filter(
98-
branch__project=baseline_exe.project).order_by('-date')[0]
97+
baseline_revs = Revision.objects.filter(
98+
branch__project=baseline_exe.project).order_by('-date')
99+
baseline_lastrev = baseline_revs[0]
100+
for rev in baseline_revs:
101+
baseline_results = Result.objects.filter(
102+
executable=baseline_exe, revision=rev, environment=env)
103+
if baseline_results:
104+
baseline_lastrev = rev
105+
break
106+
if len(baseline_results) == 0:
107+
logger.error('Could not find results for {} rev="{}" env="{}"'.format(
108+
baseline_exe, baseline_lastrev, env))
99109
data['baseline'] = '{} {}'.format(
100110
settings.DEF_BASELINE['executable'], baseline_lastrev.tag)
101-
baseline_results = Result.objects.filter(
102-
executable=baseline_exe, revision=baseline_lastrev, environment=env)
103111

104112
default_exe = Executable.objects.get(name=settings.DEF_EXECUTABLE)
105113
default_branch = Branch.objects.get(
@@ -108,21 +116,24 @@ def gethistoricaldata(request):
108116

109117
# Fetch tagged revisions for default executable
110118
default_taggedrevs = Revision.objects.filter(
111-
branch=default_branch
112-
).exclude(tag="").order_by('date')
113-
data['tagged_revs'] = [rev.tag for rev in default_taggedrevs]
119+
branch=default_branch
120+
).exclude(tag="").order_by('date')
114121
default_results = {}
115122
for rev in default_taggedrevs:
116-
default_results[rev.tag] = Result.objects.filter(
123+
res = Result.objects.filter(
117124
executable=default_exe, revision=rev, environment=env)
118-
125+
if not res:
126+
logger.info('no results for %s %s %s' % (str(default_exe), str(rev), str(env)))
127+
continue
128+
default_results[rev.tag] = res
129+
data['tagged_revs'] = [rev.tag for rev in default_taggedrevs if rev.tag in default_results]
119130
# Fetch data for latest results
120131
revs = Revision.objects.filter(
121132
branch=default_branch).order_by('-date')[:5]
122133
default_lastrev = None
123134
for i in range(4):
124135
default_lastrev = revs[i]
125-
if default_lastrev.results.filter(executable=default_exe):
136+
if default_lastrev.results.filter(executable=default_exe, environment=env):
126137
break
127138
default_lastrev = None
128139
if default_lastrev is None:
@@ -892,7 +903,6 @@ def add_result(request):
892903
return HttpResponseBadRequest(response)
893904
else:
894905
create_report_if_enough_data(response[0], response[1], response[2])
895-
logger.debug("add_result: completed")
896906
return HttpResponse("Result data saved successfully", status=202)
897907

898908

@@ -917,15 +927,11 @@ def add_json_results(request):
917927
else:
918928
unique_reports.add(response)
919929

920-
logger.debug("add_json_results: about to create reports")
921930
for rep in unique_reports:
922931
create_report_if_enough_data(rep[0], rep[1], rep[2])
923932

924-
logger.debug("add_json_results: completed")
925-
926933
return HttpResponse("All result data saved successfully", status=202)
927934

928-
929935
def django_has_content_type():
930936
return (django.VERSION[0] > 1 or
931937
(django.VERSION[0] == 1 and django.VERSION[1] >= 6))

deploy-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.
2+
psycopg2==2.7.7
3+
gunicorn==19.9.0
3.15 KB
Binary file not shown.

example/settings.py

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
# -*- coding: utf-8 -*-
2+
# Django settings for a speedcenter project.
3+
import os
4+
import os.path
5+
import sys
6+
7+
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
8+
9+
DEBUG = True
10+
TEMPLATE_DEBUG = DEBUG
11+
12+
BASEDIR = os.path.dirname(__file__)
13+
14+
#: The directory which should contain checked out source repositories:
15+
REPOSITORY_BASE_PATH = os.path.join(BASEDIR, "repos")
16+
17+
ADMINS = (
18+
# ('Your Name', 'your_email@domain.com'),
19+
)
20+
21+
MANAGERS = ADMINS
22+
DATABASES = {
23+
'default': {
24+
'ENGINE': 'django.db.backends.sqlite3',
25+
'NAME': os.path.join(BASEDIR, 'data.db'),
26+
}
27+
}
28+
29+
# Local time zone for this installation. Choices can be found here:
30+
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
31+
# although not all choices may be available on all operating systems.
32+
# If running in a Windows environment this must be set to the same as your
33+
# system time zone.
34+
TIME_ZONE = 'America/Chicago'
35+
36+
# Language code for this installation. All choices can be found here:
37+
# http://www.i18nguy.com/unicode/language-identifiers.html
38+
LANGUAGE_CODE = 'en-us'
39+
40+
SITE_ID = 1
41+
42+
# If you set this to False, Django will make some optimizations so as not
43+
# to load the internationalization machinery.
44+
USE_I18N = False
45+
46+
# Absolute path to the directory that holds media.
47+
# Example: "/home/media/media.lawrence.com/"
48+
MEDIA_ROOT = os.path.join(BASEDIR, "media")
49+
50+
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
51+
# trailing slash if there is a path component (optional in other cases).
52+
# Examples: "http://media.lawrence.com", "http://example.com/media/"
53+
MEDIA_URL = '/media/'
54+
55+
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
56+
# trailing slash.
57+
# Examples: "http://foo.com/media/", "/media/".
58+
ADMIN_MEDIA_PREFIX = '/static/admin/'
59+
60+
# Make this unique, and don't share it with anybody.
61+
SECRET_KEY = 'as%n_m#)^vee2pe91^^@c))sl7^c6t-9r8n)_69%)2yt+(la2&'
62+
63+
# List of callables that know how to import templates from various sources.
64+
TEMPLATE_LOADERS = (
65+
'django.template.loaders.filesystem.Loader',
66+
'django.template.loaders.app_directories.Loader',
67+
# 'django.template.loaders.eggs.load_template_source',
68+
)
69+
70+
MIDDLEWARE_CLASSES = (
71+
'django.middleware.common.CommonMiddleware',
72+
'django.contrib.sessions.middleware.SessionMiddleware',
73+
'django.contrib.auth.middleware.AuthenticationMiddleware',
74+
)
75+
76+
if DEBUG:
77+
import traceback
78+
import logging
79+
80+
# Define a class that logs unhandled errors
81+
class LogUncatchedErrors:
82+
def process_exception(self, request, exception):
83+
logging.error("Unhandled Exception on request for %s\n%s" %
84+
(request.build_absolute_uri(),
85+
traceback.format_exc()))
86+
# And add it to the middleware classes
87+
MIDDLEWARE_CLASSES += ('settings.LogUncatchedErrors',)
88+
89+
# set shown level of logging output to debug
90+
logging.basicConfig(level=logging.DEBUG)
91+
92+
93+
ROOT_URLCONF = 'example.urls'
94+
95+
TEMPLATE_DIRS = (
96+
os.path.join(os.path.dirname(__file__), 'templates'),
97+
)
98+
99+
TEMPLATE_CONTEXT_PROCESSORS = (
100+
'django.contrib.auth.context_processors.auth',
101+
'django.contrib.messages.context_processors.messages',
102+
'django.core.context_processors.debug',
103+
'django.core.context_processors.i18n',
104+
'django.core.context_processors.media',
105+
'django.core.context_processors.static',
106+
'django.core.context_processors.request',
107+
)
108+
109+
INSTALLED_APPS = (
110+
'django.contrib.auth',
111+
'django.contrib.contenttypes',
112+
'django.contrib.sessions',
113+
#'django.contrib.sites',
114+
'django.contrib.admin',
115+
'django.contrib.staticfiles',
116+
'codespeed',
117+
'south'
118+
)
119+
120+
STATIC_URL = '/static/'
121+
122+
STATIC_ROOT = os.path.join(BASEDIR, "sitestatic")
123+
124+
# Codespeed settings that can be overwritten here.
125+
## General default options ##
126+
WEBSITE_NAME = "PyPy Speed Center" # This name will be used in the reports RSS feed
127+
128+
#DEF_ENVIRONMENT = None #Name of the environment which should be selected as default
129+
130+
131+
DEF_BASELINE = {'executable': 'cpython', 'revision': '101'} # Which executable + revision should be default as a baseline
132+
# Given as the name of the executable and commitid of the revision
133+
# Example: defaultbaseline = {'executable': 'myexe', 'revision': '21'}
134+
135+
#TREND = 10 # Default value for the depth of the trend
136+
# Used by reports for the latest runs and changes view
137+
138+
# Threshold that determines when a performance change over the last result is significant
139+
CHANGE_THRESHOLD = 5.0
140+
141+
# Threshold that determines when a performance change
142+
# over a number of revisions is significant
143+
TREND_THRESHOLD = 6.0
144+
145+
## Changes view options ##
146+
#DEF_EXECUTABLE = None # Executable that should be chosen as default in the changes view
147+
# Given as the name of the executable.
148+
# Example: defaultexecutable = "myexe"
149+
150+
## Timeline view options ##
151+
#DEF_BENCHMARK = "grid" # Default selected benchmark. Possible values:
152+
# "grid": will show the grid of plots
153+
# "show_none": will just show a text message
154+
# "mybench": will select benchmark "mybench"
155+
156+
#TIMELINE_BRANCHES = True # NOTE: Only the default branch is currently shown
157+
# Get timeline results for specific branches
158+
# Set to False if you want timeline plots and results only for trunk.
159+
160+
## Comparison view options ##
161+
#CHART_TYPE = 'normal bars' # The options are 'normal bars', 'stacked bars' and 'relative bars'
162+
163+
NORMALIZATION = True # True will enable normalization as the default selection
164+
# in the Comparison view. The default normalization can be
165+
# chosen in the defaultbaseline setting
166+
167+
#CHART_ORIENTATION = 'vertical' # 'vertical' or 'horizontal can be chosen as
168+
# default chart orientation
169+
170+
COMP_EXECUTABLES = [('pypy-c-jit', 'L'), ('pypy-c', 'L')] # Which executable + revision should be checked as default
171+
# Given as a list of tuples containing the
172+
# name of an executable + commitid of a revision
173+
# An 'L' denotes the last revision
174+
# Example:
175+
# COMP_EXECUTABLES = [
176+
# ('myexe', '21df2423ra'),
177+
# ('myexe', 'L'),]
178+
179+
from .local_settings import *
180+

0 commit comments

Comments
 (0)