You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2015/08/26 17:51:08 UTC

[1/2] trafficserver git commit: TS-3842: Add stats for HTTP/2 errors Stating more errors

Repository: trafficserver
Updated Branches:
  refs/heads/6.0.x 1a8e29106 -> 1b6dcea63


TS-3842: Add stats for HTTP/2 errors
Stating more errors

(cherry picked from commit 73dca11323f7286e394bbcb23abc7013e0fa0e41)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1b6dcea6
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1b6dcea6
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1b6dcea6

Branch: refs/heads/6.0.x
Commit: 1b6dcea632d1b61c6f437d8d5789c8a073ef83ba
Parents: 1f1b8bf
Author: Bryan Call <bc...@apache.org>
Authored: Wed Aug 26 08:47:39 2015 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Aug 26 08:50:54 2015 -0700

----------------------------------------------------------------------
 proxy/http2/Http2ConnectionState.cc | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b6dcea6/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 9714ee4..e14f005 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -740,9 +740,7 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
     }
 
     if (error.cls != HTTP2_ERROR_CLASS_NONE) {
-      EThread *ethread = this_ethread();
       if (error.cls == HTTP2_ERROR_CLASS_CONNECTION) {
-        HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_CONNECTION_ERRORS_COUNT, ethread);
         this->send_goaway_frame(last_streamid, error.code);
         cleanup_streams();
         // XXX We need to think a bit harder about how to coordinate the client
@@ -754,7 +752,6 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
         // half-closed state ...
         SET_HANDLER(&Http2ConnectionState::state_closed);
       } else if (error.cls == HTTP2_ERROR_CLASS_STREAM) {
-        HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_STREAM_ERRORS_COUNT, ethread);
         this->send_rst_stream_frame(last_streamid, error.code);
       }
     }
@@ -1006,6 +1003,10 @@ Http2ConnectionState::send_rst_stream_frame(Http2StreamId id, Http2ErrorCode ec)
 {
   DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send RST_STREAM frame.", this->ua_session->connection_id());
 
+  if (ec != HTTP2_ERROR_NO_ERROR) {
+    HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_STREAM_ERRORS_COUNT, this_ethread());
+  }
+
   Http2Frame rst_stream(HTTP2_FRAME_TYPE_RST_STREAM, id, 0);
 
   rst_stream.alloc(buffer_size_index[HTTP2_FRAME_TYPE_RST_STREAM]);
@@ -1073,6 +1074,10 @@ Http2ConnectionState::send_goaway_frame(Http2StreamId id, Http2ErrorCode ec)
 {
   DebugSsn(this->ua_session, "http2_cs", "[%" PRId64 "] Send GOAWAY frame.", this->ua_session->connection_id());
 
+  if (ec != HTTP2_ERROR_NO_ERROR) {
+    HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_CONNECTION_ERRORS_COUNT, this_ethread());
+  }
+
   Http2Frame frame(HTTP2_FRAME_TYPE_GOAWAY, 0, 0);
   Http2Goaway goaway;
 


[2/2] trafficserver git commit: TS-3842: Add stats for HTTP/2 errors

Posted by bc...@apache.org.
TS-3842: Add stats for HTTP/2 errors

(cherry picked from commit f8928a7c0c6e822cdfd380ec301102704d686e60)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1f1b8bfb
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1f1b8bfb
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1f1b8bfb

Branch: refs/heads/6.0.x
Commit: 1f1b8bfbfe99c902a8d4cde039a315d5a8e1237f
Parents: 1a8e291
Author: Bryan Call <bc...@apache.org>
Authored: Fri Aug 14 20:24:59 2015 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Aug 26 08:50:54 2015 -0700

----------------------------------------------------------------------
 proxy/http2/HTTP2.cc                | 6 ++++++
 proxy/http2/HTTP2.h                 | 2 ++
 proxy/http2/Http2ConnectionState.cc | 3 +++
 3 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1f1b8bfb/proxy/http2/HTTP2.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc
index 7510985..b635f48 100644
--- a/proxy/http2/HTTP2.cc
+++ b/proxy/http2/HTTP2.cc
@@ -38,6 +38,8 @@ static char const *const HTTP2_STAT_CURRENT_CLIENT_STREAM_NAME = "proxy.process.
 static char const *const HTTP2_STAT_TOTAL_CLIENT_STREAM_NAME = "proxy.process.http2.total_client_streams";
 static char const *const HTTP2_STAT_TOTAL_TRANSACTIONS_TIME_NAME = "proxy.process.http2.total_transactions_time";
 static char const *const HTTP2_STAT_TOTAL_CLIENT_CONNECTION_NAME = "proxy.process.http2.total_client_connections";
+static char const *const HTTP2_STAT_CONNECTION_ERRORS_NAME = "proxy.process.http2.connection_errors";
+static char const *const HTTP2_STAT_STREAM_ERRORS_NAME = "proxy.process.http2.stream_errors";
 
 union byte_pointer {
   byte_pointer(void *p) : ptr(p) {}
@@ -773,6 +775,10 @@ Http2::init()
                      static_cast<int>(HTTP2_STAT_TOTAL_TRANSACTIONS_TIME), RecRawStatSyncSum);
   RecRegisterRawStat(http2_rsb, RECT_PROCESS, HTTP2_STAT_TOTAL_CLIENT_CONNECTION_NAME, RECD_INT, RECP_PERSISTENT,
                      static_cast<int>(HTTP2_STAT_TOTAL_CLIENT_CONNECTION_COUNT), RecRawStatSyncSum);
+  RecRegisterRawStat(http2_rsb, RECT_PROCESS, HTTP2_STAT_CONNECTION_ERRORS_NAME, RECD_INT, RECP_PERSISTENT,
+                     static_cast<int>(HTTP2_STAT_CONNECTION_ERRORS_COUNT), RecRawStatSyncSum);
+  RecRegisterRawStat(http2_rsb, RECT_PROCESS, HTTP2_STAT_STREAM_ERRORS_NAME, RECD_INT, RECP_PERSISTENT,
+                     static_cast<int>(HTTP2_STAT_STREAM_ERRORS_COUNT), RecRawStatSyncSum);
 }
 
 #if TS_HAS_TESTS

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1f1b8bfb/proxy/http2/HTTP2.h
----------------------------------------------------------------------
diff --git a/proxy/http2/HTTP2.h b/proxy/http2/HTTP2.h
index 1db5585..3177fa3 100644
--- a/proxy/http2/HTTP2.h
+++ b/proxy/http2/HTTP2.h
@@ -68,6 +68,8 @@ enum {
   HTTP2_STAT_CURRENT_CLIENT_STREAM_COUNT,   // Current # of active HTTP2 streams.
   HTTP2_STAT_TOTAL_TRANSACTIONS_TIME,       // Total stream time and streams
   HTTP2_STAT_TOTAL_CLIENT_CONNECTION_COUNT, // Total connections running http2
+  HTTP2_STAT_STREAM_ERRORS_COUNT,
+  HTTP2_STAT_CONNECTION_ERRORS_COUNT,
 
   HTTP2_N_STATS // Terminal counter, NOT A STAT INDEX.
 };

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1f1b8bfb/proxy/http2/Http2ConnectionState.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 89910be..9714ee4 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -740,7 +740,9 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
     }
 
     if (error.cls != HTTP2_ERROR_CLASS_NONE) {
+      EThread *ethread = this_ethread();
       if (error.cls == HTTP2_ERROR_CLASS_CONNECTION) {
+        HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_CONNECTION_ERRORS_COUNT, ethread);
         this->send_goaway_frame(last_streamid, error.code);
         cleanup_streams();
         // XXX We need to think a bit harder about how to coordinate the client
@@ -752,6 +754,7 @@ Http2ConnectionState::main_event_handler(int event, void *edata)
         // half-closed state ...
         SET_HANDLER(&Http2ConnectionState::state_closed);
       } else if (error.cls == HTTP2_ERROR_CLASS_STREAM) {
+        HTTP2_INCREMENT_THREAD_DYN_STAT(HTTP2_STAT_STREAM_ERRORS_COUNT, ethread);
         this->send_rst_stream_frame(last_streamid, error.code);
       }
     }