You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/11/07 00:47:31 UTC

[trafficserver] 01/02: Add Metrics to track SSL Handshake attempts

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 83ae3c88863187b9ee367dd5ba489182fc31454c
Author: Sudheer Vinukonda <su...@apache.org>
AuthorDate: Fri Nov 1 10:35:58 2019 -0700

    Add Metrics to track SSL Handshake attempts
    
    Remove debug logs
    
    (cherry picked from commit d22de244f665237ec68346691ef8bb455bcde356)
---
 iocore/net/SSLNetVConnection.cc | 2 ++
 iocore/net/SSLStats.cc          | 4 ++++
 iocore/net/SSLStats.h           | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index a29f1b2..d5771f5 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -1107,6 +1107,7 @@ SSLNetVConnection::sslServerHandShakeEvent(int &err)
 
   // Go do the preaccept hooks
   if (sslHandshakeHookState == HANDSHAKE_HOOKS_PRE) {
+    SSL_INCREMENT_DYN_STAT(ssl_total_attempts_handshake_count_in_stat);
     if (!curHook) {
       Debug("ssl", "Initialize preaccept curHook from NULL");
       curHook = ssl_hooks->get(TSSslHookInternalID(TS_VCONN_START_HOOK));
@@ -1352,6 +1353,7 @@ SSLNetVConnection::sslClientHandShakeEvent(int &err)
 
   // Go do the preaccept hooks
   if (sslHandshakeHookState == HANDSHAKE_HOOKS_OUTBOUND_PRE) {
+    SSL_INCREMENT_DYN_STAT(ssl_total_attempts_handshake_count_out_stat);
     if (!curHook) {
       Debug("ssl", "Initialize outbound connect curHook from NULL");
       curHook = ssl_hooks->get(TSSslHookInternalID(TS_VCONN_OUTBOUND_START_HOOK));
diff --git a/iocore/net/SSLStats.cc b/iocore/net/SSLStats.cc
index 9ab09ed..a29adc3 100644
--- a/iocore/net/SSLStats.cc
+++ b/iocore/net/SSLStats.cc
@@ -132,8 +132,12 @@ SSLInitializeStatistics()
   // SSL handshake time
   RecRegisterRawStat(ssl_rsb, RECT_PROCESS, "proxy.process.ssl.total_handshake_time", RECD_COUNTER, RECP_PERSISTENT,
                      (int)ssl_total_handshake_time_stat, RecRawStatSyncSum);
+  RecRegisterRawStat(ssl_rsb, RECT_PROCESS, "proxy.process.ssl.total_attempts_handshake_count_in", RECD_COUNTER, RECP_PERSISTENT,
+                     (int)ssl_total_attempts_handshake_count_in_stat, RecRawStatSyncCount);
   RecRegisterRawStat(ssl_rsb, RECT_PROCESS, "proxy.process.ssl.total_success_handshake_count_in", RECD_COUNTER, RECP_PERSISTENT,
                      (int)ssl_total_success_handshake_count_in_stat, RecRawStatSyncCount);
+  RecRegisterRawStat(ssl_rsb, RECT_PROCESS, "proxy.process.ssl.total_attempts_handshake_count_out", RECD_COUNTER, RECP_PERSISTENT,
+                     (int)ssl_total_attempts_handshake_count_out_stat, RecRawStatSyncCount);
   RecRegisterRawStat(ssl_rsb, RECT_PROCESS, "proxy.process.ssl.total_success_handshake_count_out", RECD_COUNTER, RECP_PERSISTENT,
                      (int)ssl_total_success_handshake_count_out_stat, RecRawStatSyncCount);
 
diff --git a/iocore/net/SSLStats.h b/iocore/net/SSLStats.h
index 2ad0ce0..ccd6e93 100644
--- a/iocore/net/SSLStats.h
+++ b/iocore/net/SSLStats.h
@@ -68,6 +68,7 @@ enum SSL_Stats {
   ssl_user_agent_session_miss_stat,
   ssl_user_agent_session_timeout_stat,
   ssl_total_handshake_time_stat,
+  ssl_total_attempts_handshake_count_in_stat,
   ssl_total_success_handshake_count_in_stat,
   ssl_total_tickets_created_stat,
   ssl_total_tickets_verified_stat,
@@ -89,6 +90,7 @@ enum SSL_Stats {
   ssl_error_read_eos,
   ssl_error_ssl,
   ssl_sni_name_set_failure,
+  ssl_total_attempts_handshake_count_out_stat,
   ssl_total_success_handshake_count_out_stat,
 
   /* ocsp stapling stats */