zwoop commented on code in PR #12763:
URL: https://github.com/apache/trafficserver/pull/12763#discussion_r2855616503
##########
src/iocore/net/SSLStats.cc:
##########
@@ -280,6 +280,8 @@ SSLInitializeStatistics()
ssl_rsb.user_agent_version_too_high =
Metrics::Counter::createPtr("proxy.process.ssl.user_agent_version_too_high");
ssl_rsb.user_agent_version_too_low =
Metrics::Counter::createPtr("proxy.process.ssl.user_agent_version_too_low");
ssl_rsb.user_agent_wrong_version =
Metrics::Counter::createPtr("proxy.process.ssl.user_agent_wrong_version");
+ ssl_rsb.tls_handshake_bytes_in_total =
Metrics::Counter::createPtr("proxy.process.ssl.total_handshake_bytes_read_in");
+ ssl_rsb.tls_handshake_bytes_out_total =
Metrics::Counter::createPtr("proxy.process.ssl.total_handshake_bytes_write_in");
Review Comment:
Feed
##########
src/iocore/net/SSLStats.cc:
##########
@@ -280,6 +280,8 @@ SSLInitializeStatistics()
ssl_rsb.user_agent_version_too_high =
Metrics::Counter::createPtr("proxy.process.ssl.user_agent_version_too_high");
ssl_rsb.user_agent_version_too_low =
Metrics::Counter::createPtr("proxy.process.ssl.user_agent_version_too_low");
ssl_rsb.user_agent_wrong_version =
Metrics::Counter::createPtr("proxy.process.ssl.user_agent_wrong_version");
+ ssl_rsb.tls_handshake_bytes_in_total =
Metrics::Counter::createPtr("proxy.process.ssl.total_handshake_bytes_read_in");
+ ssl_rsb.tls_handshake_bytes_out_total =
Metrics::Counter::createPtr("proxy.process.ssl.total_handshake_bytes_write_in");
Review Comment:
Fixed
##########
include/iocore/net/TLSBasicSupport.h:
##########
@@ -103,4 +105,6 @@ class TLSBasicSupport
ink_hrtime _tls_handshake_begin_time = 0;
ink_hrtime _tls_handshake_end_time = 0;
+ uint64_t _tls_handshake_bytes_in = 0;
+ uint64_t _tls_handshake_bytes_out = 0;
Review Comment:
Fixed
##########
src/iocore/net/TLSBasicSupport.cc:
##########
@@ -72,6 +72,36 @@ TLSBasicSupport::clear()
{
this->_tls_handshake_begin_time = 0;
this->_tls_handshake_end_time = 0;
+ this->_tls_handshake_bytes_in = 0;
+ this->_tls_handshake_bytes_out = 0;
+}
+
+bool
+TLSBasicSupport::get_tls_handshake_bytes(uint64_t &bytes_in, uint64_t
&bytes_out)
+{
+ if (_tls_handshake_bytes_in > 0 || _tls_handshake_bytes_out > 0) {
+ bytes_in = _tls_handshake_bytes_in;
+ bytes_out = _tls_handshake_bytes_out;
+ return false;
+ }
+
+ SSL *ssl = this->_get_ssl_object();
+ if (ssl == nullptr) {
+ bytes_in = 0;
+ bytes_out = 0;
+ return false;
+ }
+
+ BIO *rbio = SSL_get_rbio(ssl);
+ BIO *wbio = SSL_get_wbio(ssl);
+
+ uint64_t bio_in = rbio ? BIO_number_read(rbio) : 0;
+ uint64_t bio_out = wbio ? BIO_number_written(wbio) : 0;
+
+ bytes_in = _tls_handshake_bytes_in = bio_in;
+ bytes_out = _tls_handshake_bytes_out = bio_out;
+
+ return true;
Review Comment:
I made a comment, but not doxygen. We are split-brain on this, and I don't
think we use Doxygen in here normally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]