trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shinr...@apache.org
Subject trafficserver git commit: TS-3560: Make proxy.config.http.slow.log.threshold overridable This closes #205
Date Fri, 29 May 2015 15:08:04 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master 4ce075de8 -> e49b5ccd4


TS-3560: Make proxy.config.http.slow.log.threshold overridable
This closes #205


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

Branch: refs/heads/master
Commit: e49b5ccd4dffe3c589a0bc4a0d2b284c6e2fa29b
Parents: 4ce075d
Author: Syeda Persia Aziz <persia@yahoo-inc.com>
Authored: Fri May 29 09:36:29 2015 -0500
Committer: shinrich <shinrich@yahoo-inc.com>
Committed: Fri May 29 10:07:38 2015 -0500

----------------------------------------------------------------------
 CHANGES                                          | 2 ++
 doc/reference/api/TSHttpOverridableConfig.en.rst | 1 +
 lib/ts/apidefs.h.in                              | 1 +
 plugins/conf_remap/conf_remap.cc                 | 1 -
 plugins/experimental/ts_lua/ts_lua_http_config.c | 4 +++-
 proxy/InkAPI.cc                                  | 8 ++++++++
 proxy/http/HttpConfig.cc                         | 4 ++--
 proxy/http/HttpConfig.h                          | 6 ++----
 proxy/http/HttpSM.cc                             | 3 +--
 9 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e49b5ccd/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 4755a6b..4e8b6e6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 6.0.0
+
+  *) [TS-3560] Make proxy.config.http.slow.log.threshold overridable
   
   *) [TS-3635] Fix some ASAN memory issues.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e49b5ccd/doc/reference/api/TSHttpOverridableConfig.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/api/TSHttpOverridableConfig.en.rst b/doc/reference/api/TSHttpOverridableConfig.en.rst
index 5cc5e23..f63fdfa 100644
--- a/doc/reference/api/TSHttpOverridableConfig.en.rst
+++ b/doc/reference/api/TSHttpOverridableConfig.en.rst
@@ -135,6 +135,7 @@ The following configurations (from ``records.config``) are overridable.
 |   :ts:cv:`proxy.config.http.accept_encoding_filter_enabled`
 |   :ts:cv:`proxy.config.http.cache.range.write`
 |   :ts:cv:`proxy.config.http.global_user_agent_header`
+|   :ts:cv:`proxy.config.http.slow.log.threshold`
 
 Examples
 ========

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e49b5ccd/lib/ts/apidefs.h.in
----------------------------------------------------------------------
diff --git a/lib/ts/apidefs.h.in b/lib/ts/apidefs.h.in
index 3d95688..bd847f2 100644
--- a/lib/ts/apidefs.h.in
+++ b/lib/ts/apidefs.h.in
@@ -678,6 +678,7 @@ typedef enum {
   TS_CONFIG_HTTP_POST_CHECK_CONTENT_LENGTH_ENABLED,
   TS_CONFIG_HTTP_GLOBAL_USER_AGENT_HEADER,
   TS_CONFIG_HTTP_AUTH_SERVER_SESSION_PRIVATE,
+  TS_CONFIG_HTTP_SLOW_LOG_THRESHOLD,
   TS_CONFIG_LAST_ENTRY
 } TSOverridableConfigKey;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e49b5ccd/plugins/conf_remap/conf_remap.cc
----------------------------------------------------------------------
diff --git a/plugins/conf_remap/conf_remap.cc b/plugins/conf_remap/conf_remap.cc
index 32b0799..a6281aa 100644
--- a/plugins/conf_remap/conf_remap.cc
+++ b/plugins/conf_remap/conf_remap.cc
@@ -270,7 +270,6 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char * /* errbuf
ATS_UNUSE
   }
 
   RemapConfigs *conf = new (RemapConfigs);
-
   for (int i = 2; i < argc; ++i) {
     if (strchr(argv[i], '=') != NULL) {
       // Parse as an inline key=value pair ...

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e49b5ccd/plugins/experimental/ts_lua/ts_lua_http_config.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/ts_lua/ts_lua_http_config.c b/plugins/experimental/ts_lua/ts_lua_http_config.c
index f840625..2894a12 100644
--- a/plugins/experimental/ts_lua/ts_lua_http_config.c
+++ b/plugins/experimental/ts_lua/ts_lua_http_config.c
@@ -81,7 +81,8 @@ typedef enum {
   TS_LUA_CONFIG_HTTP_CACHE_FUZZ_PROBABILITY = TS_CONFIG_HTTP_CACHE_FUZZ_PROBABILITY,
   TS_LUA_CONFIG_NET_SOCK_PACKET_MARK_OUT = TS_CONFIG_NET_SOCK_PACKET_MARK_OUT,
   TS_LUA_CONFIG_NET_SOCK_PACKET_TOS_OUT = TS_CONFIG_NET_SOCK_PACKET_TOS_OUT,
-  TS_LUA_CONFIG_LAST_ENTRY = TS_CONFIG_LAST_ENTRY
+  TS_LUA_CONFIG_HTTP_SLOW_LOG_THRESHOLD = TS_CONFIG_HTTP_SLOW_LOG_THRESHOLD,
+  TS_LUA_CONFIG_LAST_ENTRY = TS_CONFIG_LAST_ENTRY,
 } TSLuaOverridableConfigKey;
 
 typedef enum {
@@ -140,6 +141,7 @@ ts_lua_var_item ts_lua_http_config_vars[] = {
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_RESPONSE_SERVER_STR), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_HEURISTIC_LM_FACTOR),
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_CACHE_FUZZ_PROBABILITY), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_NET_SOCK_PACKET_MARK_OUT),
   TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_NET_SOCK_PACKET_TOS_OUT), TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_LAST_ENTRY),
+  TS_LUA_MAKE_VAR_ITEM(TS_LUA_CONFIG_HTTP_SLOW_LOG_THRESHOLD),
 };
 
 ts_lua_var_item ts_lua_http_timeout_vars[] = {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e49b5ccd/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 8bca4bf..41176ae 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -7949,6 +7949,10 @@ _conf_to_memberp(TSOverridableConfigKey conf, OverridableHttpConfigParams
*overr
     typ = OVERRIDABLE_TYPE_STRING;
     ret = &overridableHttpConfig->global_user_agent_header;
     break;
+  case TS_CONFIG_HTTP_SLOW_LOG_THRESHOLD:
+    typ = OVERRIDABLE_TYPE_INT;
+    ret = &overridableHttpConfig->slow_log_threshold;
+    break;
 
   // This helps avoiding compiler warnings, yet detect unhandled enum members.
   case TS_CONFIG_NULL:
@@ -8233,6 +8237,10 @@ TSHttpTxnConfigFind(const char *name, int length, TSOverridableConfigKey
*conf,
       if (!strncmp(name, "proxy.config.net.sock_packet_tos_out", length))
         cnf = TS_CONFIG_NET_SOCK_PACKET_TOS_OUT;
       break;
+    case 'd':
+      if (!strncmp(name, "proxy.config.http.slow.log.threshold", length))
+        cnf = TS_CONFIG_HTTP_SLOW_LOG_THRESHOLD;
+      break;
     }
     break;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e49b5ccd/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index f82c2de..7a7e9af 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1120,7 +1120,7 @@ HttpConfig::startup()
 
   HttpEstablishStaticConfigByte(c.errors_log_error_pages, "proxy.config.http.errors.log_error_pages");
 
-  HttpEstablishStaticConfigLongLong(c.slow_log_threshold, "proxy.config.http.slow.log.threshold");
+  HttpEstablishStaticConfigLongLong(c.oride.slow_log_threshold, "proxy.config.http.slow.log.threshold");
 
   HttpEstablishStaticConfigByte(c.record_cop_page, "proxy.config.http.record_heartbeat");
 
@@ -1380,7 +1380,7 @@ HttpConfig::reconfigure()
   params->reverse_proxy_enabled = INT_TO_BOOL(m_master.reverse_proxy_enabled);
   params->url_remap_required = INT_TO_BOOL(m_master.url_remap_required);
   params->errors_log_error_pages = INT_TO_BOOL(m_master.errors_log_error_pages);
-  params->slow_log_threshold = m_master.slow_log_threshold;
+  params->oride.slow_log_threshold = m_master.oride.slow_log_threshold;
   params->record_cop_page = INT_TO_BOOL(m_master.record_cop_page);
   params->oride.send_http11_requests = m_master.oride.send_http11_requests;
   params->oride.doc_in_cache_skip_dns = INT_TO_BOOL(m_master.oride.doc_in_cache_skip_dns);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e49b5ccd/proxy/http/HttpConfig.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index 4534c6c..fc3cec8 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -383,7 +383,7 @@ struct OverridableHttpConfigParams {
       post_connect_attempts_timeout(1800), down_server_timeout(300), client_abort_threshold(10),
freshness_fuzz_time(240),
       freshness_fuzz_min_time(0), max_cache_open_read_retries(-1), cache_open_read_retry_time(10),
       background_fill_active_timeout(60), http_chunking_size(4096), flow_high_water_mark(0),
flow_low_water_mark(0),
-      default_buffer_size_index(8), default_buffer_water_mark(32768),
+      default_buffer_size_index(8), default_buffer_water_mark(32768), slow_log_threshold(0),
 
       // Strings / floats must come last
       proxy_response_server_string(NULL), proxy_response_server_string_len(0), global_user_agent_header(NULL),
@@ -555,7 +555,7 @@ struct OverridableHttpConfigParams {
 
   MgmtInt default_buffer_size_index;
   MgmtInt default_buffer_water_mark;
-
+  MgmtInt slow_log_threshold;
   // IMPORTANT: Here comes all strings / floats configs.
 
   ///////////////////////////////////////////////////////////////////
@@ -708,8 +708,6 @@ public:
   // Error Reporting //
   /////////////////////
   MgmtByte errors_log_error_pages;
-  MgmtInt slow_log_threshold;
-
   MgmtByte enable_http_info;
 
   // Cluster time delta is not a config variable,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e49b5ccd/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 0453747..0ed6640 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -6649,8 +6649,7 @@ HttpSM::update_stats()
 
 
   // print slow requests if the threshold is set (> 0) and if we are over the time threshold
-  if (t_state.http_config_param->slow_log_threshold != 0 &&
-      ink_hrtime_from_msec(t_state.http_config_param->slow_log_threshold) < total_time)
{
+  if (t_state.txn_conf->slow_log_threshold != 0 && ink_hrtime_from_msec(t_state.txn_conf->slow_log_threshold)
< total_time) {
     URL *url = t_state.hdr_info.client_request.url_get();
     char url_string[256] = "";
     int offset = 0;


Mime
View raw message