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>
<!DOCTYPE HTML>
<html>
<html>
<head>
<head>
<title>
Go benchmarks
</title>
<title>
{{benchmark}} - Benchmarks - Go Dashboard
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/static/style.css"
>
<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>
</head>
</head>
<body>
<body>
<h1>
Go dashboard - {{benchmark}}
</h1>
<ul
class=
"menu"
>
<li><a
href=
"/"
>
Build Status
</a></li>
<a
href=
"/"
>
build status
</a>
<br>
<li><a
href=
"/package"
>
Packages
</a></li>
<a
href=
"/benchmarks"
>
benchmarks
</a>
<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>
<h2>
{{benchmark}}
</h2>
<a
href=
"{{benchmark}}?fmt=json"
>
json
</a>
<a
href=
"{{benchmark}}?fmt=json"
>
json
</a>
{% for g in graphs %}
{% for g in graphs %}
...
...
misc/dashboard/godashboard/benchmarks.html
View file @
7678c5bf
<!DOCTYPE HTML>
<!DOCTYPE HTML>
<html>
<html>
<head>
<head>
<title>
Go benchmarks
</title>
<title>
Benchmarks - Go Dashboard
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"/static/style.css"
>
<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>
</head>
</head>
<body>
<body>
<h1>
Go dashboard - benchmarks
</h1>
<ul
class=
"menu"
>
<li><a
href=
"/"
>
Build Status
</a></li>
<a
href=
"/"
>
build status
</a>
<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>
<h2>
Benchmarks
</h2>
<table
class=
"alternate"
cellpadding=
"0"
cellspacing=
"0"
>
<table
class=
"alternate"
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<tr>
<th></th>
<th></th>
...
@@ -65,15 +25,17 @@
...
@@ -65,15 +25,17 @@
{% endfor %}
{% endfor %}
</tr>
</tr>
{% for
m in benchmark
s %}
{% for
bm in row
s %}
<tr>
<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"
>
<td
class=
"result"
>
{% if b.url %}
{% if bl.url %}
<img
src=
"{{b.url}}&chs=80x20&chf=bg,s,00000000&chco=000000ff&chls=1,1,0"
>
<img
src=
"{{bl.url}}"
/>
{% endif %}
{% else %}
<img
src=
"/benchmarks/single?benchmark={{bm.name}}&builder={{bl.name}}"
/>
{% endif %}
</td>
</td>
{% endfor %}
{% endfor %}
</tr>
</tr>
...
...
misc/dashboard/godashboard/gobuild.py
View file @
7678c5bf
...
@@ -388,25 +388,20 @@ class Benchmarks(webapp.RequestHandler):
...
@@ -388,25 +388,20 @@ class Benchmarks(webapp.RequestHandler):
def
compute
(
self
,
num
):
def
compute
(
self
,
num
):
benchmarks
,
builders
=
benchmark_list
()
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
)):
rows
=
[]
benchmark
=
benchmarks
[
i
]
for
bm
in
benchmarks
:
builds
=
rows
[
i
][
"builds"
]
row
=
{
'name'
:
bm
,
'builders'
:
[]}
minr
,
maxr
,
bybuilder
=
benchmark_data
(
benchmark
)
for
bl
in
builders
:
for
j
in
range
(
len
(
builders
)):
key
=
"single-%s-%s"
%
(
bm
,
bl
)
builder
=
builders
[
j
]
url
=
memcache
.
get
(
key
)
cell
=
builds
[
j
]
row
[
'builders'
].
append
({
'name'
:
bl
,
'url'
:
url
})
if
len
(
bybuilder
)
>
0
and
builder
==
bybuilder
[
0
][
0
]:
rows
.
append
(
row
)
cell
[
"url"
]
=
benchmark_sparkline
(
bybuilder
[
0
][
2
])
bybuilder
=
bybuilder
[
1
:]
path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'benchmarks.html'
)
path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'benchmarks.html'
)
data
=
{
data
=
{
"b
enchmarks"
:
rows
,
"b
uilders"
:
[
builderInfo
(
b
)
for
b
in
builders
]
,
"
builders"
:
[
builderInfo
(
b
)
for
b
in
builders
]
"
rows"
:
rows
,
}
}
return
template
.
render
(
path
,
data
)
return
template
.
render
(
path
,
data
)
...
@@ -464,6 +459,34 @@ class Benchmarks(webapp.RequestHandler):
...
@@ -464,6 +459,34 @@ class Benchmarks(webapp.RequestHandler):
self
.
response
.
set_status
(
200
)
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
):
def
node
(
num
):
q
=
Commit
.
all
()
q
=
Commit
.
all
()
q
.
filter
(
'num ='
,
num
)
q
.
filter
(
'num ='
,
num
)
...
@@ -535,19 +558,19 @@ def benchmark_sparkline(ns):
...
@@ -535,19 +558,19 @@ def benchmark_sparkline(ns):
# Encoding is 0-61, which is fine enough granularity for our tiny graphs. _ means missing.
# Encoding is 0-61, which is fine enough granularity for our tiny graphs. _ means missing.
encoding
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
encoding
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
s
=
''
.
join
([
x
<
0
and
"_"
or
encoding
[
int
((
len
(
encoding
)
-
1
)
*
x
/
m
)]
for
x
in
ns
])
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
return
url
def
benchmark_list
():
def
benchmark_list
():
q
=
BenchmarkResults
.
all
()
q
=
BenchmarkResults
.
all
()
q
.
order
(
'__key__'
)
q
.
order
(
'__key__'
)
q
.
filter
(
'builder = '
,
u'darwin-amd64'
)
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
=
BenchmarkResults
.
all
()
q
.
order
(
'__key__'
)
q
.
order
(
'__key__'
)
q
.
filter
(
'benchmark ='
,
u'math_test.BenchmarkSqrt'
)
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
return
benchmarks
,
builders
...
@@ -682,6 +705,7 @@ application = webapp.WSGIApplication(
...
@@ -682,6 +705,7 @@ application = webapp.WSGIApplication(
(
'/init'
,
Init
),
(
'/init'
,
Init
),
(
'/build'
,
Build
),
(
'/build'
,
Build
),
(
'/benchmarks'
,
Benchmarks
),
(
'/benchmarks'
,
Benchmarks
),
(
'/benchmarks/single'
,
SingleBenchmark
),
(
'/benchmarks/.*'
,
GetBenchmarks
),
(
'/benchmarks/.*'
,
GetBenchmarks
),
],
debug
=
True
)
],
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