armeria icon indicating copy to clipboard operation
armeria copied to clipboard

Collect timings related with TLS handshake

Open Leewongi0731 opened this issue 1 year ago โ€ข 6 comments

Motivation:

Collect the timings related with TLS handshake. If a request was the first in a connection, armeria could also provide it in a RequestLog to tell a user that the request timing has been affected by TLS handshake.

Modifications:

  • Add TLS handshake related field in ClientConnectionTimings
  • Add TLS handshake duration metric field at MetricCollectingClient
  • Start collecting the TLS handshake timer in the case below.
    • ~~If the client is enabled as TCP fast open in the first request, start the timer before the TCP connection.~~
    • start the timer when netty calls SslHandler.channelActive()

Result:

  • Closes #3647

Leewongi0731 avatar Apr 28 '24 13:04 Leewongi0731

๐Ÿ” Build Scanยฎ (commit: 43eca15c25c2fff78d9332fe8db980cc588eb893)

Job name Status Build Scanยฎ
build-windows-latest-jdk-19 โœ… https://ge.armeria.dev/s/ch7tpdqlqmh6u
build-self-hosted-unsafe-jdk-8 โœ… https://ge.armeria.dev/s/pxczxoqz7shf6
build-self-hosted-unsafe-jdk-19-snapshot-blockhound โœ… https://ge.armeria.dev/s/l6pwhyqgjf5ku
build-self-hosted-unsafe-jdk-17-min-java-17-coverage โœ… https://ge.armeria.dev/s/nfk24356rofpu
build-self-hosted-unsafe-jdk-17-min-java-11 โœ… https://ge.armeria.dev/s/m63yyh7w2rvrq
build-self-hosted-unsafe-jdk-17-leak โœ… https://ge.armeria.dev/s/ivmsuqx7uzfpm
build-self-hosted-unsafe-jdk-11 โœ… https://ge.armeria.dev/s/lcplfewunk2as
build-macos-12-jdk-19 โœ… https://ge.armeria.dev/s/756u4aui7sdee

github-actions[bot] avatar Apr 28 '24 14:04 github-actions[bot]

Additionally, shouldn't the check condition at the bottom be >0 instead of >=0??

  • https://github.com/line/armeria/blob/3033fea128169e0bfeb52f8486730b743e371f9c/core/src/main/java/com/linecorp/armeria/common/logging/ClientConnectionTimingsBuilder.java#L84
  • https://github.com/line/armeria/blob/3033fea128169e0bfeb52f8486730b743e371f9c/core/src/main/java/com/linecorp/armeria/common/logging/ClientConnectionTimingsBuilder.java#L135

Leewongi0731 avatar May 02 '24 05:05 Leewongi0731

Additionally, shouldn't the check condition at the bottom be >0 instead of >=0??

Oops, I think so. ๐Ÿ˜“

minwoox avatar May 02 '24 06:05 minwoox

Oops, I think so. ๐Ÿ˜“

If find a bug while working on a different issue like this, should I make and work on a separate issue ticket or fix it together in this PR?

Leewongi0731 avatar May 02 '24 08:05 Leewongi0731

should I make and work on a separate issue ticket or fix it together in this PR?

It's your choice, but I prefer that it be handled separately

jrhee17 avatar May 03 '24 07:05 jrhee17

It's your choice, but I prefer that it be handled separately

Okay, I will make new issue and new PR!!

Leewongi0731 avatar May 03 '24 08:05 Leewongi0731

Great job, @Leewongi0731! ๐Ÿ˜Š

minwoox avatar May 20 '24 07:05 minwoox