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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
9646eb93
Commit
9646eb93
authored
2 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
NodeInfo: add storage stats
parent
0df2fbe5
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
include/opendht/callbacks.h
+2
-0
2 additions, 0 deletions
include/opendht/callbacks.h
src/dhtrunner.cpp
+1
-0
1 addition, 0 deletions
src/dhtrunner.cpp
with
3 additions
and
0 deletions
include/opendht/callbacks.h
+
2
−
0
View file @
9646eb93
...
...
@@ -82,6 +82,8 @@ struct OPENDHT_PUBLIC NodeInfo {
NodeStats
ipv4
{};
NodeStats
ipv6
{};
size_t
ongoing_ops
{
0
};
size_t
storage_values
{
0
};
size_t
storage_size
{
0
};
in_port_t
bound4
{
0
};
in_port_t
bound6
{
0
};
...
...
This diff is collapsed.
Click to expand it.
src/dhtrunner.cpp
+
1
−
0
View file @
9646eb93
...
...
@@ -572,6 +572,7 @@ DhtRunner::getNodeInfo(std::function<void(std::shared_ptr<NodeInfo>)> cb)
info
.
node_id
=
dht
.
getNodeId
();
info
.
ipv4
=
dht
.
getNodesStats
(
AF_INET
);
info
.
ipv6
=
dht
.
getNodesStats
(
AF_INET6
);
std
::
tie
(
info
.
storage_size
,
info
.
storage_values
)
=
dht
.
getStoreSize
();
if
(
auto
sock
=
dht
.
getSocket
())
{
info
.
bound4
=
sock
->
getBoundRef
(
AF_INET
).
getPort
();
info
.
bound6
=
sock
->
getBoundRef
(
AF_INET6
).
getPort
();
...
...
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