Skip to content

stream_info: adding more upstream timing metrics.#18976

Merged
yanavlasov merged 9 commits intoenvoyproxy:mainfrom
alyssawilk:connect_timing
Nov 16, 2021
Merged

stream_info: adding more upstream timing metrics.#18976
yanavlasov merged 9 commits intoenvoyproxy:mainfrom
alyssawilk:connect_timing

Conversation

@alyssawilk
Copy link
Copy Markdown
Contributor

Risk Level: low
Testing: integration
Docs Changes: n/a
Release Notes: inline

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@alyssawilk
Copy link
Copy Markdown
Contributor Author

cc @AndresGuedez @yanavlasov as we may want to use these in house and not just E-M

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
if (error == 0) {
ENVOY_CONN_LOG(debug, "connected", *this);
connecting_ = false;
onConnected();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only client connection will hit this branch.

Although the server connection's onConnected() is no-op for now, I suggest adding the onConnected() here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This interval tracks the time it took from the connect call to connection being connected. This can only be applicable to upstream/client connections.

Copy link
Copy Markdown
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

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

LGTM modulo comment.

/wait

}
Http::FilterTrailersStatus encodeTrailers(Http::ResponseTrailerMap& trailers) override {
StreamInfo::UpstreamTiming& upstream_timing = decoder_callbacks_->streamInfo().upstreamTiming();
// Upstream metrics aren't available until the response is complete.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add this into the comment on the StreamInfo::upstreamTiming() API, please?

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Copy link
Copy Markdown
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

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

LGTM modulo comment

}

void onUpstreamHandshakeComplete(TimeSource& time_source) {
upstream_handshake_complete_ = time_source.monotonicTime();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Naive question, I notice the other events assert the event time was not prior set. What's the reason for UpstreamHandshakeComplete to diverge?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

largely laziness - I didn't want to rewrite a bunch of unit tests to land this PR and the unit tests break the (integration test passing) invariant.

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
@yanavlasov yanavlasov merged commit 3da250c into envoyproxy:main Nov 16, 2021
@AndresGuedez
Copy link
Copy Markdown
Contributor

This is great, thanks Alyssa!

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.

6 participants