Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sbench
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Sami Evangelista
sbench
Commits
d61eaa50
Commit
d61eaa50
authored
2 years ago
by
Sami Evangelista
Browse files
Options
Downloads
Patches
Plain Diff
parameter hash_dir for FileStorage
parent
76373965
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sbench/file_storage.py
+3
-5
3 additions, 5 deletions
sbench/file_storage.py
sbench/test_sbench.py
+2
-1
2 additions, 1 deletion
sbench/test_sbench.py
with
5 additions
and
6 deletions
sbench/file_storage.py
+
3
−
5
View file @
d61eaa50
...
...
@@ -25,14 +25,12 @@ class FileStorage(Storage):
def
_get_dir
(
self
,
run
:
'
Run
'
)
->
str
:
sub_dirs
=
list
(
run
.
assign
.
values
())
if
not
self
.
hash_dir
:
result
=
os
.
path
.
join
(
*
sub_dirs
)
else
:
if
self
.
hash_dir
:
hval
=
hashlib
.
sha256
(
'
;
'
.
join
(
sub_dirs
).
encode
(
'
utf-8
'
)
).
hexdigest
()
result
=
os
.
path
.
join
(
hval
[:
2
],
hval
[
2
:
4
],
hval
[
4
:]
)
return
result
sub_dirs
=
[
hval
[:
2
],
hval
[
2
:
4
],
hval
[
4
:]
]
return
os
.
path
.
join
(
self
.
bench
.
get_dir
(),
'
runs
'
,
*
sub_dirs
)
def
_get_mdata_file
(
self
,
run
:
'
Run
'
)
->
str
:
return
os
.
path
.
join
(
self
.
_get_dir
(
run
),
'
_mdata.json
'
)
...
...
This diff is collapsed.
Click to expand it.
sbench/test_sbench.py
+
2
−
1
View file @
d61eaa50
...
...
@@ -39,7 +39,8 @@ def mk_test_ls_benchmark() -> Benchmark:
"
recursive ==
'
recursive
'
=> dir !=
'
tmp
'"
],
"
storage
"
:
{
"
type
"
:
"
file
"
"
type
"
:
"
file
"
,
"
hash_dir
"
:
True
}
})
...
...
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