Skip to content

Commit

Permalink
Merging in changes
Browse files Browse the repository at this point in the history
  • Loading branch information
David Buchmann committed Jan 27, 2011
2 parents 634f736 + fbe3014 commit 886c1bd
Show file tree
Hide file tree
Showing 32 changed files with 1,062 additions and 565 deletions.
23 changes: 18 additions & 5 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
== Change Log ==

=== Version 0.7.0, Jan 20, 2011 ===

Major features:
* New home page with result Reports: show summary of latest benchmark runs
* RSS feed showing Reports
* Support for Netbooks, tablets, and smartphones screen sizes through the use of media query
* Big performance improvements in the Changes and Timeline views
* Added settings for change and trend thresholds and default comparison executables


=== Version 0.6.2, Jul 25, 2010 ===

Bug Fix release
Expand Down Expand Up @@ -43,7 +53,7 @@ Bug fix release
This release brings a new view, together with many other changes. Unfortunately the DB Schema had to be changed, so it is not compatible with existing databases without migration. The decision was taken in order to make the executable model simpler.

* DB Modifications:
o Executable: removed coptions and added a description fields. This is the main reason for a DB change, as it really didn't bring much and it made things unecessarily complicated
o Executable: removed coptions and added a description field, as it really didn't bring much and it made things unecessarily complicated. This is the main reason for a DB change
o Benchmark: Added a units_title field, which is used as plot title
o Charfield lengths where adjusted
* New feature: Comparison view
Expand All @@ -59,7 +69,7 @@ This release brings a new view, together with many other changes. Unfortunately
o Added plot title


0.5
=== Version 0.5, May 10, 2010 ===

The focus of this release was polishing, making everything work seamlessly and cementing the DB design. The DB Schema should remain stable from now on. Last but not least, the installation and configuration process of codespeed was greatly simplified and is now documented.

Expand All @@ -85,7 +95,8 @@ Changelog
* Multiple Hosts (Environments): it now just works
* Multiple Projects: more than one project can know be default (tracked)

0.4

=== Version 0.4, April 13, 2010 ===

* DB Redesign (http://github.com/tobami/codespeed/blob/master/documentation/backend.png)
o New Project model
Expand All @@ -102,7 +113,8 @@ Changelog
o Add std dev column
o Show all commit logs between the selected revision and the (tested) one preceding it.

0.3

=== Version 0.3, March 10, 2010 ===

* Plot Grid: a new default view for Timeline, showing all benchmarks at the same time
o Thanks go to nsf (no.smile.face) for helping with the implementation
Expand All @@ -113,7 +125,8 @@ Changelog
o Moved templates to its subdirectory
* Several bug fixes

0.2

=== Version 0.2, March 09, 2010 ===

* First working version for speed.pypy.org
* Backend
Expand Down
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -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](http://speed.pypy.org) and [Twisted](http://speed.twistedmatrix.com).

# Requirements
You will need Python 2.6+ and Django 1.1+.

Expand Down Expand Up @@ -58,13 +60,24 @@ The layout will stay exactly the same for any image with a height of 48px (any w
The file `speedcenter/codespeed/settings.py` can contain customizations of several parameters (the file includes comments with full examples).

General settings:

* defaultexecutable: in the Changes view, a random executable is chosen as default. It that doesn't suite you, you can specify here which one should be selected. You need to specify its id (since the name alone is not unique).
* defaultbaseline: Defines which baseline option will be chosen as default in the Timeline and Changes views.
* defaultenvironment: Defines which environment should be selected as default in the Changes and Timeline views.

* website_name: The RSS results feed will use this parameter as the site name
* def_baseline: Defines which baseline option will be chosen as default in the Timeline and Changes views.
* def_environment: Defines which environment should be selected as default in the Changes and Timeline views.
* change_threshold
* trend_threshold

Changes view settings:
* def_executable: in the Changes view, a random executable is chosen as default. It that doesn't suite you, you can specify here which one should be selected. You need to specify its id (since the name alone is not unique).
Comparison view settings:

* charttype: Chooses the default chart type (normal bars, stacked bars or relative bars)
* normalization: Defines whether normalization should be enabled as default in the Comparison view.
* orientation: horizontal or vertical
* comp_executables: per default all executables will be checked. When there are a large number of tags or executables, it is better to only select a few so that the plots are not too cluttered.

## Getting help
For help regarding the configuration of Codespeed, or to share any ideas or suggestions you may have, please post on Codespeed's "discussion group":http://groups.google.com/group/codespeed

## Reporting bugs

If you find any bug in Codespeed please report it on "https://github.com/tobami/codespeed/issues":https://github.com/tobami/codespeed/issues
10 changes: 9 additions & 1 deletion speedcenter/codespeed/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from codespeed.models import Project, Revision, Executable, Benchmark, Result, Environment
from codespeed.models import Project, Revision, Executable, Benchmark
from codespeed.models import Result, Environment, Report
from django.contrib import admin

class ProjectAdmin(admin.ModelAdmin):
Expand All @@ -21,6 +22,7 @@ class ExecutableAdmin(admin.ModelAdmin):

class BenchmarkAdmin(admin.ModelAdmin):
list_display = ('name', 'benchmark_type', 'description', 'units_title', 'units', 'lessisbetter')
ordering = ['name']

admin.site.register(Benchmark, BenchmarkAdmin)

Expand All @@ -34,3 +36,9 @@ class ResultAdmin(admin.ModelAdmin):
list_filter = ('date', 'executable', 'benchmark', 'environment')

admin.site.register(Result, ResultAdmin)

class ReportAdmin(admin.ModelAdmin):
list_display = ('revision', 'summary', 'colorcode')
ordering = ['-revision']

admin.site.register(Report, ReportAdmin)
12 changes: 12 additions & 0 deletions speedcenter/codespeed/feeds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from django.contrib.syndication.feeds import Feed
from codespeed.models import Report
from codespeed import settings


class LatestEntries(Feed):
title = settings.website_name
link = "/changes/"
description = "Last benchmark runs"

def items(self):
return Report.objects.order_by('-revision')[:10]
63 changes: 63 additions & 0 deletions speedcenter/codespeed/mercurial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import os, datetime
from subprocess import Popen, PIPE
from speedcenter import settings


path = settings.BASEDIR + '/repos/'

def updaterepo(repo):
repodir = path + repo.split('/')[-1] + "/"
if os.path.exists(repodir):
# Update repo
cmd = "hg pull -u"
p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE, cwd=repodir)
stdout, stderr = p.communicate()
if stderr:
return [{'error': True, 'message': stderr}]
else:
return [{'error': False}]
else:
# Clone repo
cmd = "hg clone %s" % repo
p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE, cwd=path)
stdout, stderr = p.communicate()
if stderr:
return [{'error': True, 'message': stderr}]
else:
return [{'error': False}]

def getlogs(endrev, startrev):
repodir = path + endrev.project.repo_path.split('/')[-1] + "/"
if not os.path.exists(repodir):
updaterepo(endrev.project.repo_path)

cmd = "hg log -r %s:%s -b default --template '{rev}:{node|short}\n{author|person} / {author|user}\n{date}\n{desc}\n=newlog=\n'" % (endrev.commitid, startrev.commitid)
p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE, cwd=repodir)
stdout, stderr = p.communicate()
if stderr:
return [{'error': True, 'message': stderr}]
else:
logs = []
for log in stdout.split("=newlog=\n"):
commitid, author, date, message = ("","","","")
elements = []
elements = log.split('\n')[:-1]
if len(elements) < 4:
# Don't save "malformed" log
continue
else:
commitid = elements.pop(0)
author = elements.pop(0)
date = elements.pop(0)
# All other newlines should belong to the description text. Join.
message = '\n'.join(elements)

# Parse date
date = date.split('-')[0]
date = datetime.datetime.fromtimestamp(float(date)).strftime("%Y-%m-%d %H:%M:%S")

# Add changeset info
logs.append({
'date': date, 'author': author,
'message': message,'commitid': commitid})
return logs
Loading

0 comments on commit 886c1bd

Please sign in to comment.