Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
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
mariadb
Commits
89ec7f8e
Commit
89ec7f8e
authored
Apr 12, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#211 simplify sql bench test runner
parent
a1b98694
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
76 deletions
+18
-76
scripts/run.sql.bench.bash
scripts/run.sql.bench.bash
+18
-1
scripts/sql.bench.summary.py
scripts/sql.bench.summary.py
+0
-75
No files found.
scripts/run.sql.bench.bash
View file @
89ec7f8e
...
@@ -108,7 +108,24 @@ runtests --create-options=engine=$engine --socket=$socket --verbose
...
@@ -108,7 +108,24 @@ runtests --create-options=engine=$engine --socket=$socket --verbose
popd
popd
# summarize the results
# summarize the results
python ~/bin/sql.bench.summary.py <
$testresultsdir
/
$tracefile
>
$testresultsdir
/
$summaryfile
while
read
l
;
do
if
[[
$l
=
~ ^
([
0-9]
{
8
}
\
[
0-9]
{
2
}
:[0-9]
{
2
}
:[0-9]
{
2
})(
.
*
)
$
]]
;
then
t
=
${
BASH_REMATCH
[1]
}
cmd
=
${
BASH_REMATCH
[2]
}
if
[
-z
"
$cmd
"
]
;
then
let
duration
=
$(
date
-d
"
$t
"
+%s
)
-
$(
date
-d
"
$tlast
"
+%s
)
printf
"%4s %s %8d %s
\n
"
"
$status
"
"
$tlast
"
"
$duration
"
"
$cmdlast
"
else
cmdlast
=
$cmd
tlast
=
$t
status
=
PASS
fi
else
if
[[
$l
=
~
"Got error|Died"
]]
;
then
status
=
FAIL
fi
fi
done
<
$testresultsdir
/
$tracefile
>
$testresultsdir
/
$summaryfile
testresult
=
""
testresult
=
""
pf
=
`
mktemp
`
pf
=
`
mktemp
`
...
...
scripts/sql.bench.summary.py
deleted
100755 → 0
View file @
a1b98694
#!/usr/bin/env python
# summarize the sql-bench trace file
import
sys
import
re
import
os.path
class
testreports
:
def
__init__
(
self
):
self
.
reports
=
[]
def
append
(
self
,
report
):
self
.
reports
.
append
(
report
)
def
duration
(
self
,
start
,
stop
):
t0
=
os
.
popen
(
'date -d"'
+
start
+
'" +%s'
).
readline
()
t1
=
os
.
popen
(
'date -d"'
+
stop
+
'" +%s'
).
readline
()
return
int
(
t1
)
-
int
(
t0
)
def
printit
(
self
,
i
):
report
=
self
.
reports
[
i
]
d
=
self
.
duration
(
report
[
"start"
],
report
[
"stop"
])
print
"%s %s %6u %s"
%
(
report
[
"result"
].
upper
(),
report
[
"start"
],
d
,
report
[
"name"
])
# print self.reports[i]
def
printall
(
self
):
for
i
in
range
(
len
(
self
.
reports
)):
self
.
printit
(
i
)
def
stoptime
(
self
,
stoptime
):
if
len
(
self
.
reports
)
>
0
:
lastreport
=
self
.
reports
[
-
1
]
lastreport
[
"stop"
]
=
stoptime
def
main
():
reports
=
testreports
()
testreport
=
{}
while
1
:
b
=
sys
.
stdin
.
readline
()
if
b
==
""
:
break
b
=
b
.
rstrip
(
'
\
n
'
)
match
=
re
.
match
(
"^(
\
d{8}
\
d{2}:
\
d{
2
}:
\
d{
2
})$"
,
b
)
if
match
:
if
totaltime
==
""
and
testreport
[
"result"
]
==
"pass"
:
testreport
[
"result"
]
=
"fail"
testreport
[
"stop"
]
=
match
.
group
(
1
)
reports
.
append
(
testreport
)
testreport
=
{}
continue
match
=
re
.
match
(
"^(
\
d{8}
\
d{2}:
\
d{
2
}:
\
d{
2
}) (test-.*)$"
,
b
)
if
match
:
testreport
[
"start"
]
=
match
.
group
(
1
)
testreport
[
"name"
]
=
match
.
group
(
2
)
testreport
[
"result"
]
=
"pass"
totaltime
=
""
continue
match
=
re
.
match
(
".*Got error|.*Died at"
,
b
)
if
match
:
testreport
[
"result"
]
=
"fail"
match
=
re
.
match
(
"^Total time|^Estimated total time"
,
b
)
if
match
:
totaltime
=
b
match
=
re
.
match
(
"skip"
,
b
)
if
match
:
testreport
[
"result"
]
=
"skip"
reports
.
printall
()
return
0
sys
.
exit
(
main
())
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