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

ReportListener incorrectly reports getSentBytesRate and getReceivedBytesRate #312

Open
lachlan-roberts opened this issue Apr 22, 2024 · 3 comments

Comments

@lachlan-roberts
Copy link
Member

The sentBytes and recvBytes fields on ReportListener.Report are set by ReportListener.onComplete by using the ConnectionStatistics instance.

However at the time onComplete is called the ConnectionStatistics has not been updated.

I can see at the time ReportListener.onComplete is called that both sentBytes and recvBytes are 0.

And then after I wait for reportListener.whenComplete().join() I can manually inspect the ConnectionStatistics and it has correct values (bytes in/out=2264849/2579828).

@sbordet
Copy link
Member

sbordet commented Apr 22, 2024

@lachlan-roberts ConnectionStatistics updates the values when the connection is closed.

Trying to update the values when a connection is open is racy and likely the value will be stale -- that's why it is done at connection close.

We have jetty/jetty.project#5826 to track this.

@lachlan-roberts
Copy link
Member Author

@sbordet I understand that, I'm not saying we need live connection statistics for this, but there is probably some race where ReportListener is trying to get the stats before the connection is closed.

@lachlan-roberts
Copy link
Member Author

@sbordet I confimed that ReportListener#onComplete(LoadGenerator generator) is called before any of the connections are closed with ReportListener#onClosed(Connection).

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

No branches or pull requests

2 participants