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

Fix/vpn stats #1184

Merged
merged 22 commits into from
May 11, 2022
Merged

Fix/vpn stats #1184

merged 22 commits into from
May 11, 2022

Conversation

ersonp
Copy link
Contributor

@ersonp ersonp commented May 10, 2022

Did you run make format && make check?
yes

Fixes #946

Changes:

  • Fixed bandwidth

How to test this PR:

  1. Start a vpn-server
  2. Start a vpn-client and connect to the VPN server
  3. Compare the stats in the UI with any networking tool like nload on wtun4 interface

@ersonp
Copy link
Contributor Author

ersonp commented May 10, 2022

2022-05-10.17-52-58.mp4

The upload and download speeds are now almost the same as shown in the tool nload for the tun interface. We send the data in API in bytes which I suppose is converted to bits for the upload and download speed in the UI. We need to specify it a bit more clearly that the speed is in terms of bits as compared to the total that is in terms of bytes.

[
   {
      "is_alive":true,
      "latency":196,
      "upload_speed":691,
      "download_speed":561,
      "bandwidth_sent":624761,
      "bandwidth_received":665736,
      "error":"",
      "connection_duration":89
   }
]

The latency is still a bit inaccurate (working on it so see if anything more can be done) and shoots up whenever there is a big download (tested this with meter.net) and the ping spikes there too while a download is going on so the behaviour seems normal.
image

The ping to the server the vpn-server constantly gives a ping of 240 ms
image

@mrpalide
Copy link
Contributor

mrpalide commented May 11, 2022

I test it, and can confirm that Speed and Bandwidth are OK.

vpn-stat.mov

But ping is a few different from what showing in UI and results from teminal.

image

ersonp added 4 commits May 11, 2022 13:03
This commit saves the latency in the varible latency instead of calculating it with time.Since(sentAt).Milliseconds() which caused the debug log and the SetLatency to be diffrent.

We also convert the sentAt to utc and also calculate latency with UTC. This does not change the output but we do it just to be inline with all other time calculations that are now in UTC.
This commit removes the install command for the libraries gcc libgtk-3-dev libayatana-appindicator3-dev as they are no longer needed after recent changes.
@ersonp ersonp marked this pull request as ready for review May 11, 2022 08:56
@jdknives jdknives merged commit 58f37f7 into skycoin:develop May 11, 2022
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.

4 participants