Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
9980fc89
Commit
9980fc89
authored
7 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
dhtrunner: add stats
parent
a1fc266e
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
src/dhtrunner.cpp
+12
-2
12 additions, 2 deletions
src/dhtrunner.cpp
with
12 additions
and
2 deletions
src/dhtrunner.cpp
+
12
−
2
View file @
9980fc89
...
...
@@ -410,15 +410,25 @@ DhtRunner::loop_()
received
=
std
::
move
(
rcv
);
}
if
(
not
received
.
empty
())
{
size_t
packet_num
=
received
.
size
();
auto
start
=
clock
::
now
();
while
(
not
received
.
empty
())
{
auto
&
pck
=
received
.
front
();
auto
delay
=
clock
::
now
()
-
pck
.
received
;
auto
now
=
clock
::
now
();
auto
delay
=
now
-
pck
.
received
;
if
(
delay
>
std
::
chrono
::
seconds
(
1
))
std
::
cerr
<<
"Dropping packet with high delay: "
<<
print_dt
(
delay
)
<<
std
::
endl
;
else
else
{
wakeup
=
dht
->
periodic
(
pck
.
data
.
data
(),
pck
.
data
.
size
()
-
1
,
pck
.
from
);
auto
end
=
clock
::
now
();
std
::
cerr
<<
"periodic took "
<<
print_dt
(
end
-
now
)
*
1000
<<
std
::
endl
;
}
received
.
pop
();
}
if
(
packet_num
>
1
)
{
auto
time_all
=
print_dt
(
clock
::
now
()
-
start
);
std
::
cerr
<<
"Treating "
<<
packet_num
<<
" packets took "
<<
time_all
<<
" - "
<<
(
packet_num
/
time_all
)
<<
" packets/sec"
<<
std
::
endl
;
}
}
else
{
wakeup
=
dht
->
periodic
(
nullptr
,
0
,
nullptr
,
0
);
}
...
...
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