Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
misc
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
misc
Commits
b81b9367
Commit
b81b9367
authored
Apr 28, 2016
by
Elvis Pranskevichus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Record host platform information in benchmark data
parent
d083da37
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
run_benchmarks
run_benchmarks
+6
-0
servers/platinfo.py
servers/platinfo.py
+46
-0
No files found.
run_benchmarks
View file @
b81b9367
...
...
@@ -388,7 +388,13 @@ def main():
print
()
if
args
.
save_json
:
info_cmd
=
server_base
+
python
+
[
'/usr/src/servers/platinfo.py'
]
print
(
' '
+
' '
.
join
(
info_cmd
))
output
=
subprocess
.
check_output
(
info_cmd
,
universal_newlines
=
True
)
platform_info
=
json
.
loads
(
output
)
benchmarks_data
=
{
'platform'
:
platform_info
,
'concurrency_levels'
:
args
.
concurrency_levels
,
'payload_size_levels'
:
args
.
payload_size_levels
,
'benchmarks'
:
benchmarks_data
,
...
...
servers/platinfo.py
0 → 100644
View file @
b81b9367
import
json
import
os.path
import
platform
import
warnings
if
__name__
==
'__main__'
:
machine
=
platform
.
machine
()
processor
=
platform
.
processor
()
system
=
platform
.
system
()
cpuinfo_f
=
'/proc/cpuinfo'
if
(
processor
in
{
machine
,
'unknown'
}
and
os
.
path
.
exists
(
cpuinfo_f
)):
with
open
(
cpuinfo_f
,
'rt'
)
as
f
:
for
line
in
f
:
if
line
.
startswith
(
'model name'
):
_
,
_
,
p
=
line
.
partition
(
':'
)
processor
=
p
.
strip
()
break
if
'Linux'
in
system
:
with
warnings
.
catch_warnings
():
# see issue #1322 for more information
warnings
.
filterwarnings
(
'ignore'
,
'dist
\
(
\
) and linux_distribution
\
(
\
) '
'functions are deprecated .*'
,
PendingDeprecationWarning
,
)
distname
,
distversion
,
distid
=
platform
.
dist
(
''
)
distribution
=
'{} {}'
.
format
(
distname
,
distversion
).
strip
()
else
:
distribution
=
None
data
=
{
'cpu'
:
processor
,
'arch'
:
machine
,
'system'
:
'{} {}'
.
format
(
system
,
platform
.
release
()),
'distribution'
:
distribution
}
print
(
json
.
dumps
(
data
))
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