Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
7678c5bf
Commit
7678c5bf
authored
Apr 05, 2010
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
godashboard: fix benchmarks page (first pass)
R=rsc CC=golang-dev
https://golang.org/cl/844044
parent
f08ce189
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
132 deletions
+72
-132
misc/dashboard/godashboard/benchmark1.html
misc/dashboard/godashboard/benchmark1.html
+11
-57
misc/dashboard/godashboard/benchmarks.html
misc/dashboard/godashboard/benchmarks.html
+19
-57
misc/dashboard/godashboard/gobuild.py
misc/dashboard/godashboard/gobuild.py
+42
-18
No files found.
misc/dashboard/godashboard/benchmark1.html
View file @
7678c5bf
<!DOCTYPE HTML>
<html>
<head>
<title>
Go benchmarks
</title>
<style>
h1
{
font-size
:
1em
;
font-weight
:
bold
;
}
h2
{
font-size
:
1em
;
font-weight
:
bold
;
}
table
.alternate
{
white-space
:
nowrap
;
}
table
.alternate
tr
td
{
padding-right
:
10px
;
}
table
.alternate
tr
td
:last-child
{
padding-right
:
0
;
}
table
.alternate
tr
:nth-child
(
2n
)
{
background-color
:
#f8f8f8
;
}
td
.revision
{
}
span
.hash
{
font-family
:
monospace
;
font-size
:
small
;
color
:
#aaa
;
}
span
.nodeseq
{
}
td
.user
{
font-size
:
small
;
}
td
.date
{
color
:
#aaa
;
font-size
:
small
;
}
td
.result
{
text-align
:
center
;
}
span
.ok
{
}
td
.desc
{
font-size
:
small
;
font-family
:
sans-serif
;
}
th
.builder
{
font-weight
:
bold
;
padding-right
:
0.5em
;
}
</style>
<title>
{{benchmark}} - Benchmarks - Go Dashboard
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/static/style.css"
>
</head>
<body>
<h1>
Go dashboard - {{benchmark}}
</h1>
<a
href=
"/"
>
build status
</a>
<br>
<a
href=
"/benchmarks"
>
benchmarks
</a>
<ul
class=
"menu"
>
<li><a
href=
"/"
>
Build Status
</a></li>
<li><a
href=
"/package"
>
Packages
</a></li>
<li><a
href=
"/benchmarks"
>
Benchmarks
</a></li>
<li><a
href=
"http://golang.org/"
>
golang.org
</a></li>
</ul>
<h1>
Go Dashboard
</h1>
<h2>
{{benchmark}}
</h2>
<a
href=
"{{benchmark}}?fmt=json"
>
json
</a>
{% for g in graphs %}
...
...
misc/dashboard/godashboard/benchmarks.html
View file @
7678c5bf
<!DOCTYPE HTML>
<html>
<head>
<title>
Go benchmarks
</title>
<style>
h1
{
font-size
:
1em
;
font-weight
:
bold
;
}
h2
{
font-size
:
1em
;
font-weight
:
bold
;
}
table
.alternate
{
white-space
:
nowrap
;
}
table
.alternate
tr
td
{
padding-right
:
10px
;
}
table
.alternate
tr
td
:last-child
{
padding-right
:
0
;
}
table
.alternate
tr
:nth-child
(
2n
)
{
background-color
:
#f8f8f8
;
}
td
.revision
{
}
span
.nodeseq
{
}
td
.user
{
font-size
:
small
;
}
td
.date
{
color
:
#aaa
;
font-size
:
small
;
}
td
.result
{
text-align
:
center
;
}
span
.ok
{
}
td
.desc
{
font-size
:
small
;
font-family
:
sans-serif
;
}
th
.builder
{
font-weight
:
bold
;
padding-right
:
0.5em
;
}
</style>
<title>
Benchmarks - Go Dashboard
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/static/style.css"
>
</head>
<body>
<h1>
Go dashboard - benchmarks
</h1>
<a
href=
"/"
>
build status
</a>
<ul
class=
"menu"
>
<li><a
href=
"/"
>
Build Status
</a></li>
<li><a
href=
"/package"
>
Packages
</a></li>
<li>
Benchmarks
</li>
<li><a
href=
"http://golang.org/"
>
golang.org
</a></li>
</ul>
<h1>
Go Dashboard
</h1>
<h2>
Benchmarks
</h2>
<table
class=
"alternate"
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<th></th>
...
...
@@ -65,15 +25,17 @@
{% endfor %}
</tr>
{% for
m in benchmark
s %}
{% for
bm in row
s %}
<tr>
<td
class=
"name"
><a
href=
"/benchmarks/{{
m.name}}"
>
{{
m.name}}
</a></td>
<td
class=
"name"
><a
href=
"/benchmarks/{{
bm.name}}"
>
{{b
m.name}}
</a></td>
{% for b
in m.build
s %}
{% for b
l in bm.builder
s %}
<td
class=
"result"
>
{% if b.url %}
<img
src=
"{{b.url}}&chs=80x20&chf=bg,s,00000000&chco=000000ff&chls=1,1,0"
>
{% endif %}
{% if bl.url %}
<img
src=
"{{bl.url}}"
/>
{% else %}
<img
src=
"/benchmarks/single?benchmark={{bm.name}}&builder={{bl.name}}"
/>
{% endif %}
</td>
{% endfor %}
</tr>
...
...
misc/dashboard/godashboard/gobuild.py
View file @
7678c5bf
...
...
@@ -388,25 +388,20 @@ class Benchmarks(webapp.RequestHandler):
def
compute
(
self
,
num
):
benchmarks
,
builders
=
benchmark_list
()
# Build empty grid, to be filled in.
rows
=
[{
"name"
:
bm
,
"builds"
:
[{
"url"
:
""
}
for
b
in
builders
]}
for
bm
in
benchmarks
]
for
i
in
range
(
len
(
rows
)):
benchmark
=
benchmarks
[
i
]
builds
=
rows
[
i
][
"builds"
]
minr
,
maxr
,
bybuilder
=
benchmark_data
(
benchmark
)
for
j
in
range
(
len
(
builders
)):
builder
=
builders
[
j
]
cell
=
builds
[
j
]
if
len
(
bybuilder
)
>
0
and
builder
==
bybuilder
[
0
][
0
]:
cell
[
"url"
]
=
benchmark_sparkline
(
bybuilder
[
0
][
2
])
bybuilder
=
bybuilder
[
1
:]
rows
=
[]
for
bm
in
benchmarks
:
row
=
{
'name'
:
bm
,
'builders'
:
[]}
for
bl
in
builders
:
key
=
"single-%s-%s"
%
(
bm
,
bl
)
url
=
memcache
.
get
(
key
)
row
[
'builders'
].
append
({
'name'
:
bl
,
'url'
:
url
})
rows
.
append
(
row
)
path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'benchmarks.html'
)
data
=
{
"b
enchmarks"
:
rows
,
"
builders"
:
[
builderInfo
(
b
)
for
b
in
builders
]
"b
uilders"
:
[
builderInfo
(
b
)
for
b
in
builders
]
,
"
rows"
:
rows
,
}
return
template
.
render
(
path
,
data
)
...
...
@@ -464,6 +459,34 @@ class Benchmarks(webapp.RequestHandler):
self
.
response
.
set_status
(
200
)
class
SingleBenchmark
(
webapp
.
RequestHandler
):
"""
Fetch data for single benchmark/builder combination
and return sparkline url as HTTP redirect, also set memcache entry.
"""
def
get
(
self
):
benchmark
=
self
.
request
.
get
(
'benchmark'
)
builder
=
self
.
request
.
get
(
'builder'
)
key
=
"single-%s-%s"
%
(
benchmark
,
builder
)
url
=
memcache
.
get
(
key
)
if
url
is
None
:
minr
,
maxr
,
bybuilder
=
benchmark_data
(
benchmark
)
for
bb
in
bybuilder
:
if
bb
[
0
]
!=
builder
:
continue
url
=
benchmark_sparkline
(
bb
[
2
])
if
url
is
None
:
self
.
response
.
set_status
(
500
,
"No data found"
)
return
memcache
.
set
(
key
,
url
,
700
)
# slightly longer than bench timeout
self
.
response
.
set_status
(
302
)
self
.
response
.
headers
.
add_header
(
"Location"
,
url
)
def
node
(
num
):
q
=
Commit
.
all
()
q
.
filter
(
'num ='
,
num
)
...
...
@@ -535,19 +558,19 @@ def benchmark_sparkline(ns):
# Encoding is 0-61, which is fine enough granularity for our tiny graphs. _ means missing.
encoding
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
s
=
''
.
join
([
x
<
0
and
"_"
or
encoding
[
int
((
len
(
encoding
)
-
1
)
*
x
/
m
)]
for
x
in
ns
])
url
=
"http://chart.apis.google.com/chart?cht=ls&chd=s:"
+
s
url
=
"http://chart.apis.google.com/chart?cht=ls&chd=s:"
+
s
+
"&chs=80x20&chf=bg,s,00000000&chco=000000ff&chls=1,1,0"
return
url
def
benchmark_list
():
q
=
BenchmarkResults
.
all
()
q
.
order
(
'__key__'
)
q
.
filter
(
'builder = '
,
u'darwin-amd64'
)
benchmarks
=
[
r
.
benchmark
for
r
in
q
.
fetch
(
1000
)
]
benchmarks
=
[
r
.
benchmark
for
r
in
q
]
q
=
BenchmarkResults
.
all
()
q
.
order
(
'__key__'
)
q
.
filter
(
'benchmark ='
,
u'math_test.BenchmarkSqrt'
)
builders
=
[
r
.
builder
for
r
in
q
.
fetch
(
10
0
)]
builders
=
[
r
.
builder
for
r
in
q
.
fetch
(
2
0
)]
return
benchmarks
,
builders
...
...
@@ -682,6 +705,7 @@ application = webapp.WSGIApplication(
(
'/init'
,
Init
),
(
'/build'
,
Build
),
(
'/benchmarks'
,
Benchmarks
),
(
'/benchmarks/single'
,
SingleBenchmark
),
(
'/benchmarks/.*'
,
GetBenchmarks
),
],
debug
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment