Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
a2f4070e
Commit
a2f4070e
authored
4 years ago
by
Dariusz Kędzierski
Browse files
Options
Downloads
Patches
Plain Diff
Time is now presented in ms
parent
a25de36b
No related branches found
No related tags found
2 merge requests
!456
Release candidate v1 24
,
!246
API tests execution time reports
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/ci/json_report_parser.py
+4
-4
4 additions, 4 deletions
scripts/ci/json_report_parser.py
scripts/ci/start_api_benchmark.py
+2
-2
2 additions, 2 deletions
scripts/ci/start_api_benchmark.py
with
6 additions
and
6 deletions
scripts/ci/json_report_parser.py
+
4
−
4
View file @
a2f4070e
...
...
@@ -80,16 +80,16 @@ def json_report_parser(path_to_test_dir, json_file, time_threshold=1.0):
ofile
.
write
(
"
</head>
\n
"
)
ofile
.
write
(
"
<body>
\n
"
)
ofile
.
write
(
"
<table>
\n
"
)
ofile
.
write
(
"
<tr><th>Test name</th><th>Min time [s]</th><th>Max time [s]</th><th>Mean time [s]</th></tr>
\n
"
)
ofile
.
write
(
"
<tr><th>Test name</th><th>Min time [
m
s]</th><th>Max time [
m
s]</th><th>Mean time [
m
s]</th></tr>
\n
"
)
json_data
=
None
with
open
(
json_file
,
"
r
"
)
as
json_file
:
json_data
=
load
(
json_file
)
for
benchmark
in
json_data
[
'
benchmarks
'
]:
if
float
(
benchmark
[
'
stats
'
][
'
mean
'
])
>
time_threshold
:
ofile
.
write
(
"
<tr><td>{}<br/>Parameters: {}</td><td>{:.4f}</td><td>{:.4f}</td><td bgcolor=
\"
red
\"
>{:.4f}</td></tr>
\n
"
.
format
(
benchmark
[
'
name
'
],
get_request_from_yaml
(
class_to_path
(
benchmark
[
'
name
'
][
5
:],
class_to_path_dic
)),
benchmark
[
'
stats
'
][
'
min
'
],
benchmark
[
'
stats
'
][
'
max
'
],
benchmark
[
'
stats
'
][
'
mean
'
]))
above_treshold
.
append
((
benchmark
[
'
name
'
],
"
{:.4f}
"
.
format
(
benchmark
[
'
stats
'
][
'
mean
'
]),
get_request_from_yaml
(
class_to_path
(
benchmark
[
'
name
'
][
5
:],
class_to_path_dic
))))
ofile
.
write
(
"
<tr><td>{}<br/>Parameters: {}</td><td>{:.4f}</td><td>{:.4f}</td><td bgcolor=
\"
red
\"
>{:.4f}</td></tr>
\n
"
.
format
(
benchmark
[
'
name
'
],
get_request_from_yaml
(
class_to_path
(
benchmark
[
'
name
'
][
5
:],
class_to_path_dic
)),
benchmark
[
'
stats
'
][
'
min
'
]
*
1000
,
benchmark
[
'
stats
'
][
'
max
'
]
*
1000
,
benchmark
[
'
stats
'
][
'
mean
'
]
*
1000
))
above_treshold
.
append
((
benchmark
[
'
name
'
],
"
{:.4f}
"
.
format
(
benchmark
[
'
stats
'
][
'
mean
'
]
*
1000
),
get_request_from_yaml
(
class_to_path
(
benchmark
[
'
name
'
][
5
:],
class_to_path_dic
))))
else
:
ofile
.
write
(
"
<tr><td>{}</td><td>{:.4f}</td><td>{:.4f}</td><td>{:.4f}</td></tr>
\n
"
.
format
(
benchmark
[
'
name
'
],
benchmark
[
'
stats
'
][
'
min
'
],
benchmark
[
'
stats
'
][
'
max
'
],
benchmark
[
'
stats
'
][
'
mean
'
]))
ofile
.
write
(
"
<tr><td>{}</td><td>{:.4f}</td><td>{:.4f}</td><td>{:.4f}</td></tr>
\n
"
.
format
(
benchmark
[
'
name
'
],
benchmark
[
'
stats
'
][
'
min
'
]
*
1000
,
benchmark
[
'
stats
'
][
'
max
'
]
*
1000
,
benchmark
[
'
stats
'
][
'
mean
'
]
*
1000
))
ofile
.
write
(
"
</table>
\n
"
)
ofile
.
write
(
"
</body>
\n
"
)
ofile
.
write
(
"
</html>
\n
"
)
...
...
This diff is collapsed.
Click to expand it.
scripts/ci/start_api_benchmark.py
+
2
−
2
View file @
a2f4070e
...
...
@@ -101,8 +101,8 @@ if __name__ == "__main__":
if
failed
:
from
prettytable
import
PrettyTable
summary
=
PrettyTable
()
print
(
"
########## Test failed with following tests above {}s threshold ##########
"
.
format
(
args
.
time_threshold
))
summary
.
field_names
=
[
'
Test name
'
,
'
Mean time [s]
'
,
'
Call parameters
'
]
print
(
"
########## Test failed with following tests above {}
m
s threshold ##########
"
.
format
(
args
.
time_threshold
*
1000
))
summary
.
field_names
=
[
'
Test name
'
,
'
Mean time [
m
s]
'
,
'
Call parameters
'
]
for
entry
in
failed
:
summary
.
add_row
(
entry
)
print
(
summary
)
...
...
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