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

Issue with Rx/Tx statistics #208

Open
warlock9600 opened this issue Jun 27, 2022 · 4 comments
Open

Issue with Rx/Tx statistics #208

warlock9600 opened this issue Jun 27, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@warlock9600
Copy link

warlock9600 commented Jun 27, 2022

Hi!
I have installation of wg-access-server in kubernetes with postgres backend.

The statistics of received/transmitted bytes are not working correctly. It seems that when updating data in a multi-replicated installation, the data is not summarized, but overwritten.

Application version: wg-access-server:v0.6.0

Do you have any ideas how to fix this?

@DasSkelett
Copy link
Member

DasSkelett commented Jun 27, 2022

Yeah, it just takes the value from WireGuard for each connected peer and shoves it into the database, overwriting what's already there from other instances or before restarts.

Is it important for you that the data is correctly summed?
It is possible to do that, but it requires some work. We'd have to track the stats for each peer internally, then calculate the increase and add it to the value already in the db.

@warlock9600
Copy link
Author

not very important, but I really want this feature.
I would do it myself, but I am very weak in Go.

if necessary, I can help with testing this functionality

@warlock9600
Copy link
Author

By the way, it might be better to use the following algorithm:

  • write current statistics to dictionary
  • clear locally
  • sum the values in the database with the values from the dictionary

@DasSkelett
Copy link
Member

By the way, it might be better to use the following algorithm:

* write current statistics to dictionary

* clear locally

* sum the values in the database with the values from the dictionary

To my knowledge WireGuard doesn't allow us to clear or edit the bytes counter, only read it

@DasSkelett DasSkelett added the enhancement New feature or request label Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants