-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dht_proxy_server: add push notification statistics #725
Conversation
85bdc08
to
c1e14d6
Compare
c1e14d6
to
67169ae
Compare
@@ -98,6 +98,32 @@ class OPENDHT_PUBLIC DhtProxyServer | |||
|
|||
asio::io_context& io_context() const; | |||
|
|||
struct PushStats { | |||
uint64_t highPriorityCount {0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be atomic, see requestNum_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was simpler to add a mutex since this struct gets copied in updateStats
and that doesn't work with atomic types, hope that's ok but let me know if you'd prefer a different solution.
@@ -98,6 +98,32 @@ class OPENDHT_PUBLIC DhtProxyServer | |||
|
|||
asio::io_context& io_context() const; | |||
|
|||
struct PushStats { | |||
uint64_t highPriorityCount {0}; | |||
uint64_t normalPriorityCount {0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be atomic, see requestNum_
include/opendht/dht_proxy_server.h
Outdated
std::ostringstream ss; | ||
ss << highPriorityCount << " high priority, " | ||
<< normalPriorityCount << " normal priority"; | ||
return ss.str(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt::format("{} high priority, {} normal priority", highPriorityCount, normalPriorityCount);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
67169ae
to
9c821d0
Compare
9c821d0
to
a025895
Compare
No description provided.