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:09 UTC
[2/2] trafficserver git commit: TS-3842: Add stats for HTTP/2 errors
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);
}
}