Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dhtnet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
dhtnet
Commits
f8b33b2f
Commit
f8b33b2f
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
bench: use local node by default
Change-Id: I4030534348074592b6f2a3ff8c1f8f2cb4438ca3
parent
c3777bb6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/benchmark/main.cpp
+6
-6
6 additions, 6 deletions
tools/benchmark/main.cpp
with
6 additions
and
6 deletions
tools/benchmark/main.cpp
+
6
−
6
View file @
f8b33b2f
...
...
@@ -59,8 +59,8 @@ setupHandler(const std::string& name,
h
->
dht
=
std
::
make_shared
<
dht
::
DhtRunner
>
();
h
->
dht
->
run
(
dhtConfig
,
std
::
move
(
dhtContext
));
//
h->dht->bootstrap("127.0.0.1:36432");
h
->
dht
->
bootstrap
(
"bootstrap.jami.net"
);
h
->
dht
->
bootstrap
(
"127.0.0.1:36432"
);
//
h->dht->bootstrap("bootstrap.jami.net");
auto
config
=
std
::
make_shared
<
ConnectionManager
::
Config
>
();
config
->
dht
=
h
->
dht
;
...
...
@@ -97,8 +97,8 @@ runBench(std::shared_ptr<asio::io_context> ioContext,
std
::
unique_lock
<
std
::
mutex
>
lock
{
mtx
};
std
::
condition_variable
serverConVar
;
//
auto boostrap_node = std::make_shared<dht::DhtRunner>();
//
boostrap_node->run(36432);
auto
boostrap_node
=
std
::
make_shared
<
dht
::
DhtRunner
>
();
boostrap_node
->
run
(
36432
);
fmt
::
print
(
"Generating identities…
\n
"
);
auto
server
=
setupHandler
(
"server"
,
ioContext
,
ioContextRunner
,
factory
,
logger
);
...
...
@@ -132,7 +132,7 @@ runBench(std::shared_ptr<asio::io_context> ioContext,
constexpr
size_t
TX_GOAL
=
TX_SIZE
*
TX_NUM
;
time_point
start_connect
,
start_send
;
std
::
this_thread
::
sleep_for
(
5
s
);
std
::
this_thread
::
sleep_for
(
3
s
);
fmt
::
print
(
"Connecting…
\n
"
);
start_connect
=
clock
::
now
();
client
->
connectionManager
->
connectDevice
(
server
->
id
.
second
,
"channelName"
,
[
&
](
std
::
shared_ptr
<
ChannelSocket
>
socket
,
const
DeviceId
&
)
{
...
...
@@ -149,7 +149,7 @@ runBench(std::shared_ptr<asio::io_context> ioContext,
});
ret
.
connection
=
clock
::
now
()
-
start_connect
;
fmt
::
print
(
"Connected in {}
\n
"
,
dht
::
print_duration
(
ret
.
connection
));
std
::
vector
<
uint8_t
>
data
(
TX_SIZE
,
'y'
);
std
::
vector
<
uint8_t
>
data
(
TX_SIZE
,
(
uint8_t
)
'y'
);
std
::
error_code
ec
;
start_send
=
clock
::
now
();
for
(
unsigned
i
=
0
;
i
<
TX_NUM
;
++
i
)
{
...
...
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