Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthias Linhuber
disk-benchmark
Commits
60076264
Commit
60076264
authored
Feb 01, 2021
by
Matthias Linhuber
Browse files
Implement FileSize configuration
parent
0a26589e
Changes
1
Hide whitespace changes
Inline
Side-by-side
benchmark.py
View file @
60076264
...
...
@@ -23,6 +23,13 @@ QUICK_TEST_PARAM_LIST = [
[
2
**
20
,
2
**
0
],
]
FILESIZES
=
{
"1G"
:
20
,
"2G"
:
21
,
"4G"
:
22
,
"8G"
:
23
}
class
TestRun
():
"""
...
...
@@ -239,11 +246,10 @@ def main():
help
=
'Meausre only some block sizes'
)
parser
.
add_argument
(
"--repetitions"
,
'-r'
,
default
=
3
,
type
=
int
,
help
=
'Meausre only some block sizes'
)
parser
.
add_argument
(
"--fileSize"
,
choices
=
[
"1G"
,
"2G"
,
"5G"
,
"10G"
],
default
=
"2G"
,
help
=
"Define desired fileSize for all parameter sets - NOT IMPLEMENTED"
)
parser
.
add_argument
(
"--fileSize"
,
choices
=
FILESIZES
.
keys
(),
help
=
"Define desired fileSize for all parameter sets"
)
# Show testrun info
# Show testrun info
parser
.
add_argument
(
"--testValues"
,
action
=
"store_true"
,
help
=
"Show the test-values used for the measurements"
)
...
...
@@ -266,17 +272,19 @@ def main():
print
(
"Please only provide either --quick or --full. They are"
+
" mutaliy exclusive"
)
# TODO: Use the command line parameter to fill this value
fileSize
=
2
**
31
fileSizeExponent
=
int
(
math
.
log2
(
fileSize
))
if
args
.
full
or
args
.
fileSize
is
not
None
:
if
args
.
fileSize
is
None
:
fileSizeExponent
=
20
else
:
fileSizeExponent
=
FILESIZES
[
args
.
fileSize
]
if
args
.
full
:
testParams
=
[[
2
**
(
i
),
2
**
(
fileSizeExponent
-
i
)]
for
i
in
range
(
fileSizeExponent
)
if
i
>=
fileSizeExponent
/
2
or
i
>=
10
]
else
:
testParams
=
QUICK_TEST_PARAM_LIST
# Print testValues and exit program
if
args
.
testValues
:
pprint
(
testParams
)
return
...
...
@@ -298,7 +306,7 @@ def main():
else
:
# Print Table representation
resultManager
.
printResults
(
human
=
args
.
human
,
table
=
not
args
.
raw
,
table
=
not
args
.
json
,
showAllRepetitions
=
not
args
.
brief
)
# Store test restult if desired by the user
...
...
Write
Preview
Supports
Markdown
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