-
Notifications
You must be signed in to change notification settings - Fork 42
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
Saving websocket RTT samples #232
Conversation
Also, move that measurement data into to WSInfo sub-object as it's currently unclear if AppInfo should be extended or not. It's part of ndt7 spec :) TODO: squash this commit into previous one
I am sorry, @darkk, I meant to update this PR to master but the end result was that I merged this PR to master, which I didn't want. Can you reopen/reissue it? My apologies 🙏 |
(Weirdly enough, I could merge a PR with broken CI in master without any prompt like "hey, you want merge this, you sure? You can override if you wish", which is what I'd expect @pboothe) |
@bassosimone I'll reopen it, but I'd like to clean the code up a bit first. I've not found a good reason to send each and every |
Let me take a look at the existing code and provide further feedback. |
@bassosimone okay, it's #234. Keep in mind that I've not finished uprooting of the inelegant 14kb channel buffer yet, so that part is yet to be refactored. |
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.
Did read the diff, asked clarifying questions! (I think I have a slight preference for opening a new PR, because I'd rather have the discussion happen on a live PR rather than on a dead one, for future clarify.)
} | ||
} | ||
} | ||
} |
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.
I am ignoring the JavaScript part for now.
runSomething('ping', callback) | ||
} | ||
|
||
runPing(function() { runDownload(function() { runUpload(); }); }) | ||
</script> | ||
</body> | ||
</html> |
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.
I am ignoring the JavaScript part for now.
func Do(ctx context.Context, conn *websocket.Conn, resultfp *results.File) { | ||
// arguments are owned by the caller of this function. The start argument is | ||
// the test start time used to calculate ElapsedTime and deadlines. | ||
func Do(ctx context.Context, conn *websocket.Conn, resultfp *results.File, start time.Time) { |
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.
Passing in the start
time is very useful to start ensuring the same zero is used everywhere.
@@ -8,4 +8,5 @@ type Measurement struct { | |||
ConnectionInfo *ConnectionInfo `json:",omitempty" bigquery:"-"` | |||
BBRInfo *BBRInfo `json:",omitempty"` | |||
TCPInfo *TCPInfo `json:",omitempty"` | |||
WSInfo *WSInfo `json:",omitempty"` |
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.
This looks like PingInfo
to me.
package model | ||
|
||
// WSInfo contains an application level (websocket) ping measurement data. | ||
// It may be melded into AppInfo. |
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.
No, I'd rather actually keep them separate
receiverch := receiver.StartDownloadReceiver(wholectx, conn) | ||
measurerch := measurer.Start(wholectx, conn, resultfp.Data.UUID, start) | ||
receiverch, pongch := receiver.StartDownloadReceiver(wholectx, conn, start, measurerch) | ||
senderch := sender.Start(conn, measurerch, start, pongch) |
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.
I am confused by the fact that a new channel has been introduced. Isn't it possible to use the measurerch
for passing around information? I understood that the PING is another null
able pointer within a Measurement.
LastRTT: int64(rtt / time.Microsecond), | ||
MinRTT: int64(minRTT / time.Microsecond), | ||
} | ||
pongch <- wsinfo // Liveness: buffered (sender) |
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.
So, here I believe it should be possible to use dst
to emit a measurement containing PingInfo, right?
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.
Asked some questions
That's WIP for #192
I have a few questions I'm unsure about:
start
around the way it's implemented? It looks a bit messy to me, but I'm quite okay with that.WSInfo
messages to client in/upload
and/download
? I feel like those may be eventually useful, those datapoints feed my curiosity about queuing, but I have no immediate use for the data.WSInfo
be a separate optional sub-message in the spec or should it extendAppInfo
with optional fields?sender
(sends ping to) →[conn]
(eventually delivers pong to) →receiver
(sends RTT estimate back to client) →sender
. The current implementation uses buffered channel for RTT estimates to avoid blocking onpongch <- rtt
whilesender
is blocked onconn.send(hugeBlob)
feeding the pipe with data. I don't like 14kB being allocated just to handle the worst-case, but I did not come up with a more elegant solution.WIP:
download.sender
to get one unbiased sample of L7 RTT for each/download
for "free"spec/ndt7-protocol.md
This change is