Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
allocbench
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Fischer
allocbench
Commits
c1a6beba
Commit
c1a6beba
authored
Jul 23, 2018
by
Florian Fischer
Browse files
Options
Downloads
Patches
Plain Diff
fix status output and add bar plot
parent
976c6939
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bench_mysql.py
+32
-7
32 additions, 7 deletions
bench_mysql.py
with
32 additions
and
7 deletions
bench_mysql.py
+
32
−
7
View file @
c1a6beba
...
@@ -120,10 +120,10 @@ class Benchmark_MYSQL( Benchmark ):
...
@@ -120,10 +120,10 @@ class Benchmark_MYSQL( Benchmark ):
print
(
"
Aborting Benchmark.
"
)
print
(
"
Aborting Benchmark.
"
)
return
False
return
False
for
i
in
self
.
nthreads
:
for
i
,
thread
in
enumerate
(
self
.
nthreads
)
:
print
(
tname
+
"
:
"
,
i
,
"
of
"
,
n
,
"
\r
"
,
end
=
''
)
print
(
tname
+
"
:
"
,
i
+
1
,
"
of
"
,
n
,
"
\r
"
,
end
=
''
)
target_cmd
=
cmd
.
format
(
i
,
cwd
).
split
(
"
"
)
target_cmd
=
cmd
.
format
(
thread
,
cwd
).
split
(
"
"
)
p
=
subprocess
.
run
(
target_cmd
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
p
=
subprocess
.
run
(
target_cmd
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
universal_newlines
=
True
)
universal_newlines
=
True
)
...
@@ -144,7 +144,7 @@ class Benchmark_MYSQL( Benchmark ):
...
@@ -144,7 +144,7 @@ class Benchmark_MYSQL( Benchmark ):
result
[
"
avg
"
]
=
re
.
search
(
"
avg:\s*(\d*.\d*)
"
,
p
.
stdout
).
group
(
1
)
result
[
"
avg
"
]
=
re
.
search
(
"
avg:\s*(\d*.\d*)
"
,
p
.
stdout
).
group
(
1
)
result
[
"
max
"
]
=
re
.
search
(
"
max:\s*(\d*.\d*)
"
,
p
.
stdout
).
group
(
1
)
result
[
"
max
"
]
=
re
.
search
(
"
max:\s*(\d*.\d*)
"
,
p
.
stdout
).
group
(
1
)
key
=
(
tname
,
i
)
key
=
(
tname
,
thread
)
if
not
key
in
self
.
results
:
if
not
key
in
self
.
results
:
self
.
results
[
key
]
=
[
result
]
self
.
results
[
key
]
=
[
result
]
else
:
else
:
...
@@ -169,8 +169,10 @@ class Benchmark_MYSQL( Benchmark ):
...
@@ -169,8 +169,10 @@ class Benchmark_MYSQL( Benchmark ):
return
True
return
True
def
summary
(
self
):
def
summary
(
self
):
# linear plot
nthreads
=
self
.
results
[
"
args
"
][
"
nthreads
"
]
nthreads
=
self
.
results
[
"
args
"
][
"
nthreads
"
]
targets
=
self
.
results
[
"
targets
"
]
targets
=
self
.
results
[
"
targets
"
]
y_mapping
=
{
v
:
i
for
i
,
v
in
enumerate
(
nthreads
)}
for
target
in
targets
:
for
target
in
targets
:
y_vals
=
[
0
]
*
len
(
nthreads
)
y_vals
=
[
0
]
*
len
(
nthreads
)
...
@@ -179,14 +181,37 @@ class Benchmark_MYSQL( Benchmark ):
...
@@ -179,14 +181,37 @@ class Benchmark_MYSQL( Benchmark ):
d
=
[]
d
=
[]
for
m
in
measures
:
for
m
in
measures
:
d
.
append
(
int
(
m
[
"
transactions
"
]))
d
.
append
(
int
(
m
[
"
transactions
"
]))
y_vals
[
mid
[
1
]
-
nthreads
[
0
]]
=
np
.
mean
(
d
)
y_vals
[
y_mapping
[
mid
[
1
]
]]
=
np
.
mean
(
d
)
plt
.
plot
(
nthreads
,
y_vals
,
label
=
target
,
linestyle
=
'
-
'
,
marker
=
'
.
'
)
plt
.
plot
(
nthreads
,
y_vals
,
label
=
target
,
linestyle
=
'
-
'
,
marker
=
'
.
'
)
plt
.
legend
()
plt
.
legend
()
plt
.
xlabel
(
"
threads
"
)
plt
.
xlabel
(
"
threads
"
)
plt
.
ylabel
(
"
transactions
"
)
plt
.
ylabel
(
"
transactions
"
)
plt
.
title
(
"
sysbench oltp read only
"
)
plt
.
title
(
"
sysbench oltp read only
"
)
plt
.
savefig
(
"
mysql.ro.png
"
)
plt
.
savefig
(
self
.
file_name
+
"
.l.ro.png
"
)
plt
.
clf
()
# bar plot
nthreads
=
list
(
self
.
results
[
"
args
"
][
"
nthreads
"
])
targets
=
self
.
results
[
"
targets
"
]
y_mapping
=
{
v
:
i
for
i
,
v
in
enumerate
(
nthreads
)}
for
i
,
target
in
enumerate
(
targets
):
y_vals
=
[
0
]
*
len
(
nthreads
)
for
mid
,
measures
in
self
.
results
.
items
():
if
mid
[
0
]
==
target
:
d
=
[]
for
m
in
measures
:
d
.
append
(
int
(
m
[
"
transactions
"
]))
y_vals
[
y_mapping
[
mid
[
1
]]]
=
np
.
mean
(
d
)
plt
.
bar
([
x
-
i
/
8
for
x
in
range
(
1
,
len
(
nthreads
)
+
1
)],
y_vals
,
width
=
0.2
,
label
=
target
,
align
=
"
center
"
)
plt
.
legend
()
plt
.
xlabel
(
"
threads
"
)
plt
.
xticks
(
range
(
1
,
len
(
nthreads
)
+
1
),
nthreads
)
plt
.
ylabel
(
"
transactions
"
)
plt
.
title
(
"
sysbench oltp read only
"
)
plt
.
savefig
(
self
.
file_name
+
"
.b.ro.png
"
)
plt
.
clf
()
plt
.
clf
()
mysql
=
Benchmark_MYSQL
()
mysql
=
Benchmark_MYSQL
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment