-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for displaying median benchmarks #203
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('codespeed', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='benchmark', | ||
name='data_type', | ||
field=models.CharField(default='U', max_length=1, choices=[('U', 'Mean'), ('M', 'Median')]), | ||
), | ||
migrations.AddField( | ||
model_name='result', | ||
name='q1', | ||
field=models.FloatField(null=True, blank=True), | ||
), | ||
migrations.AddField( | ||
model_name='result', | ||
name='q3', | ||
field=models.FloatField(null=True, blank=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,6 +257,7 @@ def gettimelinedata(request): | |
'benchmark': bench.name, | ||
'benchmark_id': bench.id, | ||
'benchmark_description': bench.description, | ||
'data_type': bench.data_type, | ||
'units': bench.units, | ||
'lessisbetter': lessisbetter, | ||
'branches': {}, | ||
|
@@ -288,16 +289,37 @@ def gettimelinedata(request): | |
|
||
results = [] | ||
for res in resultquery: | ||
std_dev = "" | ||
if res.std_dev is not None: | ||
std_dev = res.std_dev | ||
results.append( | ||
[ | ||
res.revision.date.strftime('%Y/%m/%d %H:%M:%S %z'), | ||
res.value, std_dev, | ||
res.revision.get_short_commitid(), branch | ||
] | ||
) | ||
if bench.data_type == 'M': | ||
val_min = "" | ||
if res.val_min is not None: | ||
val_min = res.val_min | ||
val_max = "" | ||
if res.val_max is not None: | ||
val_max = res.val_max | ||
q1 = "" | ||
if res.q1 is not None: | ||
q1 = res.q1 | ||
q3 = "" | ||
if res.q3 is not None: | ||
q3 = res.q3 | ||
results.append( | ||
[ | ||
res.revision.date.strftime('%Y/%m/%d %H:%M:%S %z'), | ||
res.value, val_max, q3, q1, val_min, | ||
res.revision.get_short_commitid(), branch | ||
] | ||
) | ||
else: | ||
std_dev = "" | ||
if res.std_dev is not None: | ||
std_dev = res.std_dev | ||
results.append( | ||
[ | ||
res.revision.date.strftime('%Y/%m/%d %H:%M:%S %z'), | ||
res.value, std_dev, | ||
res.revision.get_short_commitid(), branch | ||
] | ||
) | ||
timeline['branches'][branch][executable] = results | ||
append = True | ||
if baselinerev is not None and append: | ||
|
@@ -424,11 +446,20 @@ def timeline(request): | |
defaultequid = data['equid'] | ||
else: | ||
defaultequid = "off" | ||
if 'quarts' in data: | ||
defaultquarts = data['quarts'] | ||
else: | ||
defaultquarts = "on" | ||
if 'extr' in data: | ||
defaultextr = data['extr'] | ||
else: | ||
defaultextr = "on" | ||
|
||
# Information for template | ||
executables = {} | ||
for proj in Project.objects.filter(track=True): | ||
executables[proj] = Executable.objects.filter(project=proj) | ||
use_median_bands = hasattr(settings, 'USE_MEDIAN_BANDS') and settings.USE_MEDIAN_BANDS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think |
||
return render_to_response('codespeed/timeline.html', { | ||
'checkedexecutables': checkedexecutables, | ||
'defaultbaseline': defaultbaseline, | ||
|
@@ -442,7 +473,10 @@ def timeline(request): | |
'environments': enviros, | ||
'branch_list': branch_list, | ||
'defaultbranch': defaultbranch, | ||
'defaultequid': defaultequid | ||
'defaultequid': defaultequid, | ||
'defaultquarts': defaultquarts, | ||
'defaultextr': defaultextr, | ||
'use_median_bands': use_median_bands, | ||
}, context_instance=RequestContext(request)) | ||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could factor out the data formatting somewhere common to both data_types. Even a method on revision
date_formatted()
or similar