diff --git a/README.md b/README.md index aa8d0058..d04c7253 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Codespeed A web application to monitor and analyze the performance of your code. +It is known to be used by [PyPy](speed.pypy.org) and [Twisted](speed.twistedmatrix.com). + # Requirements You will need Python 2.6+ and Django 1.1+. diff --git a/speedcenter/codespeed/settings.py b/speedcenter/codespeed/settings.py index 8af123ef..4f5ac82f 100644 --- a/speedcenter/codespeed/settings.py +++ b/speedcenter/codespeed/settings.py @@ -4,7 +4,7 @@ defaultbaseline = None # Which executable + revision should be default as a baseline - # Given as the id of the executable + commitid of the revision + # Given as the name of the executable and commitid of the revision # Example: defaultbaseline = {'executable': 'myexe', 'revision': '21'} # Changes view options ## @@ -21,3 +21,13 @@ chartorientation = 'vertical' # 'vertical' or 'horizontal can be chosen as # default chart orientation + +comp_defaultexecutables = None # Which executable + revision should be checked + # Given as a list of tuples containing the + # name of an executable + commitid of a revision + # An 'L' denotes the last revision + # Example: + # comp_defaultexecutables = [ + # ('myexe', '21df2423ra'), + # ('myexe', 'L'), + #] diff --git a/speedcenter/codespeed/views.py b/speedcenter/codespeed/views.py index 0ab39e64..5fb0da01 100644 --- a/speedcenter/codespeed/views.py +++ b/speedcenter/codespeed/views.py @@ -175,6 +175,29 @@ def comparison(request): if not i: continue if i in exekeys: checkedexecutables.append(i) + elif hasattr(settings, 'comp_defaultexecutables') and\ + settings.comp_defaultexecutables != None: + for exe, rev in settings.comp_defaultexecutables: + try: + exe = Executable.objects.get(name=exe) + key = str(exe.id) + "+" + if rev == "L": + key += rev + else: + rev = Revision.objects.get(commitid=rev) + key += str(rev.id) + if key in exekeys: + checkedexecutables.append(key) + else: + #TODO: log + pass + except Executable.DoesNotExist: + #TODO: log + pass + except Revision.DoesNotExist: + #TODO: log + pass + if not checkedexecutables: checkedexecutables = exekeys @@ -186,7 +209,9 @@ def comparison(request): bench_units = {} for unit in units_titles: # Only include benchmarks marked as cross-project - benchmarks[unit] = Benchmark.objects.filter(benchmark_type="C").filter(units_title=unit) + benchmarks[unit] = Benchmark.objects.filter( + benchmark_type="C" + ).filter(units_title=unit) units = benchmarks[unit][0].units lessisbetter = benchmarks[unit][0].lessisbetter and ' (less is better)' or ' (more is better)' bench_units[unit] = [[b.id for b in benchmarks[unit]], lessisbetter, units] @@ -360,6 +385,7 @@ def timeline(request): checkedexecutables.append(Executable.objects.get(id=int(i))) except Executable.DoesNotExist: pass + if not checkedexecutables: checkedexecutables = Executable.objects.filter(project__track=True)