Skip to content
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

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

fsimonfc
Copy link

@fsimonfc fsimonfc commented Oct 3, 2024

No description provided.

@@ -98,6 +98,32 @@ class OPENDHT_PUBLIC DhtProxyServer

asio::io_context& io_context() const;

struct PushStats {
uint64_t highPriorityCount {0};
Copy link
Member

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_

Copy link
Author

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};
Copy link
Member

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_

Comment on lines 120 to 123
std::ostringstream ss;
ss << highPriorityCount << " high priority, "
<< normalPriorityCount << " normal priority";
return ss.str();
Copy link
Member

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);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@aberaud aberaud merged commit df189e3 into savoirfairelinux:master Nov 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants