trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrew...@apache.org
Subject svn commit: r953892 - in /trafficserver/traffic/trunk/proxy/http2: HttpClientSession.cc HttpConfig.cc HttpConfig.h
Date Fri, 11 Jun 2010 22:22:38 GMT
Author: andrewhsu
Date: Fri Jun 11 22:22:38 2010
New Revision: 953892

URL: http://svn.apache.org/viewvc?rev=953892&view=rev
Log:
TS-18 added stats for ipv4 and ipv6 request via REC

Tested: Fedora-13-x86_64

Added stats back in using REC stats system.  Available via 'traffic_line'
when 'traffic_server' is started via 'traffic_manager':

  $ traffic_line -r proxy.process.http.total_client_connections_ipv4
  $ traffic_line -r proxy.process.http.total_client_connections_ipv6

It is assumed that this inequality will always be satisifed:

  proxy.process.http.total_client_connections >=
    proxy.process.http.total_client_connections_ipv4 +
    proxy.process.http.total_client_connections_ipv6

Modified:
    trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc
    trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc
    trafficserver/traffic/trunk/proxy/http2/HttpConfig.h

Modified: trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc?rev=953892&r1=953891&r2=953892&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpClientSession.cc Fri Jun 11 22:22:38 2010
@@ -207,6 +207,24 @@ HttpClientSession::new_connection(NetVCo
   /* inbound requests stat should be incremented here, not after the
    * header has been read */
   HTTP_INCREMENT_DYN_STAT(http_total_incoming_connections_stat);
+
+  // check what type of socket address we just accepted
+  // by looking at the address family value of sockaddr_storage
+  // and logging to stat system
+  switch(new_vc->get_remote_addr().ss_family) {
+    case AF_INET:
+      HTTP_INCREMENT_DYN_STAT(http_total_client_connections_ipv4_stat);
+    break;
+    case AF_INET6:
+      HTTP_INCREMENT_DYN_STAT(http_total_client_connections_ipv6_stat);
+    break;
+    default:
+      // don't do anything if the address family is not ipv4 or ipv6
+      // (there are many other address families in <sys/socket.h>
+      // but we don't have a need to report on all the others today)
+    break;
+  }
+
   // Record api hook set state
   hooks_set = http_global_hooks->hooks_set;
 

Modified: trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc?rev=953892&r1=953891&r2=953892&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpConfig.cc Fri Jun 11 22:22:38 2010
@@ -198,6 +198,14 @@ register_stat_callbacks()
                      RECD_COUNTER, RECP_NULL, (int) http_total_client_connections_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
+                     "proxy.process.http.total_client_connections_ipv4",
+                     RECD_COUNTER, RECP_NULL, (int) http_total_client_connections_ipv4_stat,
RecRawStatSyncCount);
+
+  RecRegisterRawStat(http_rsb, RECT_PROCESS,
+                     "proxy.process.http.total_client_connections_ipv6",
+                     RECD_COUNTER, RECP_NULL, (int) http_total_client_connections_ipv6_stat,
RecRawStatSyncCount);
+
+  RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_server_connections",
                      RECD_COUNTER, RECP_NULL, (int) http_total_server_connections_stat, RecRawStatSyncCount);
 

Modified: trafficserver/traffic/trunk/proxy/http2/HttpConfig.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/http2/HttpConfig.h?rev=953892&r1=953891&r2=953892&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/http2/HttpConfig.h (original)
+++ trafficserver/traffic/trunk/proxy/http2/HttpConfig.h Fri Jun 11 22:22:38 2010
@@ -83,7 +83,14 @@ enum
   http_ua_msecs_counts_errors_early_hangups_stat,
 
   // Http Total Connections Stats
+  //
+  // it is assumed that this inequality will always be satisifed:
+  //   http_total_client_connections_stat >=
+  //     http_total_client_connections_ipv4_stat +
+  //     http_total_client_connections_ipv6_stat
   http_total_client_connections_stat,
+  http_total_client_connections_ipv4_stat,
+  http_total_client_connections_ipv6_stat,
   http_total_server_connections_stat,
   http_total_parent_proxy_connections_stat,
   http_current_parent_proxy_connections_stat,



Mime
View raw message