Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P1163
directory_ls.py
Active
Public
Actions
Authored by
vsellier
on Sep 15 2021, 11:18 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
from
swh.storage
import
get_storage
from
swh.model.hashutil
import
hash_to_bytes
import
sys
import
time
hash
=
sys
.
argv
[
1
]
#print(hash)
#s=get_storage('remote', url='http://swh-storage:5002')
config
=
{
'cls'
:
'cassandra'
,
'hosts'
:
[
'parasilo-2'
],
'keyspace'
:
'swh'
,
'consistency_level'
:
'LOCAL_QUORUM'
,
'objstorage'
:
{
'cls'
:
'memory'
,
'args'
:
{}
}
}
#s=get_storage(cls='cassandra', hosts=['parasilo-2'], keyspace='swh', consistency_level='LOCAL_QUORUM', objstorage={cls='memory'})
s
=
get_storage
(
**
config
)
toc
=
time
.
perf_counter
()
entries
=
s
.
directory_ls
(
hash_to_bytes
(
f
"{hash}"
))
for
e
in
entries
:
pass
tac
=
time
.
perf_counter
()
print
(
f
"{hash}: {tac-toc:0.4f}s"
)
Event Timeline
vsellier
created this paste.
Sep 15 2021, 11:18 AM
2021-09-15 11:18:56 (UTC+2)
vsellier
mentioned this in
T3573: [cassandra] directory and content read benchmarks
.
Log In to Comment