trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [2/2] trafficserver git commit: TS-4255: Remove StatSystem metrics.
Date Wed, 09 Mar 2016 04:21:21 GMT
TS-4255: Remove StatSystem metrics.

proxy/StatSystem.cc contains the old metrics code that was used
prior to librecords. We don't need this any more since librecords
exists. There's also some small performance gain from removing the
duplicate metrics. This removes {stat} and {test} endpoints from
the HTTP UI.

This closes #520.


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

Branch: refs/heads/master
Commit: 896282b5b2266ecd4a6930c1974d8b174182f9f2
Parents: 325422f
Author: James Peach <jpeach@apache.org>
Authored: Wed Mar 2 21:50:31 2016 -0800
Committer: James Peach <jpeach@apache.org>
Committed: Tue Mar 8 20:20:44 2016 -0800

----------------------------------------------------------------------
 cmd/traffic_manager/StatProcessor.h         |   4 -
 doc/admin-guide/files/records.config.en.rst |  12 +-
 lib/perl/lib/Apache/TS/AdminClient.pm       |   2 -
 lib/records/I_RecCore.h                     |   2 -
 lib/records/RecCore.cc                      |  68 ---
 mgmt/RecordsConfig.cc                       |   6 -
 proxy/CacheControl.cc                       |   1 -
 proxy/DynamicStats.h                        | 103 ----
 proxy/IPAllow.cc                            |   1 -
 proxy/InkAPI.cc                             |   1 -
 proxy/InkAPIInternal.h                      |   1 -
 proxy/Main.cc                               |   7 +-
 proxy/Makefile.am                           |   5 +-
 proxy/Milestones.h                          |  76 +++
 proxy/ReverseProxy.cc                       |   1 -
 proxy/SocksProxy.cc                         |   1 -
 proxy/StatSystem.cc                         | 470 ------------------
 proxy/StatSystem.h                          | 587 -----------------------
 proxy/congest/CongestionStats.h             |   2 -
 proxy/http/HttpCacheSM.h                    |   1 -
 proxy/http/HttpConfig.h                     |   6 +-
 proxy/http/HttpSM.cc                        |   8 +-
 proxy/http/HttpSM.h                         |   1 -
 proxy/http/HttpTransact.cc                  | 459 +++++++++---------
 proxy/http/HttpTransact.h                   |  67 +--
 proxy/logging/LogField.h                    |   2 +-
 26 files changed, 303 insertions(+), 1591 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/cmd/traffic_manager/StatProcessor.h
----------------------------------------------------------------------
diff --git a/cmd/traffic_manager/StatProcessor.h b/cmd/traffic_manager/StatProcessor.h
index 0d3b751..1b7baa2 100644
--- a/cmd/traffic_manager/StatProcessor.h
+++ b/cmd/traffic_manager/StatProcessor.h
@@ -41,10 +41,6 @@
 #include "LocalManager.h"
 #include "WebOverview.h"
 
-#define _HEADER
-#define _D(x)
-#define _FOOTER
-#include "DynamicStats.h"
 #include "StatType.h"
 
 #if HAVE_LIBEXPAT

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/doc/admin-guide/files/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 1ce5d76..225a168 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -312,14 +312,6 @@ Value Effect
 Metrics Variables
 -----------------
 
-.. ts:cv:: CONFIG proxy.config.stats.snap_frequency INT 60
-
-  Interval (in seconds) at which to snapshot persistent metrics.
-
-.. ts:cv:: CONFIG proxy.config.stats.snap_file STRING "stats.snap"
-
-  Name of the file to use for snapshots of persistent metrics.
-
 .. ts:cv:: proxy.config.stats.enable_lua INT 0
 
   Whether to enable execution of the Lua-based custom metrics from
@@ -1989,7 +1981,7 @@ Customizable User Response Pages
    To enable any enpoint there needs to be an entry in :file:`remap.config` which
    specifically enables it. Such a line would look like: ::
 
-        map / http://{stat}
+        map / http://{cache}
 
    The following are the cache endpoints:
 
@@ -2001,8 +1993,6 @@ Customizable User Response Pages
    - ``hostdb`` = lookups against the hostdb
    - ``http`` = HTTPSM details, this endpoint is also gated by `proxy.config.http.enable_http_info`
    - ``net`` = lookup and listing of open connections
-   - ``stat`` = list of all records.config options and metrics
-   - ``test`` = test callback page
 
 .. ts:cv:: CONFIG proxy.config.http.enable_http_info INT 0
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/lib/perl/lib/Apache/TS/AdminClient.pm
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index dfbf999..00a3bf2 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -672,8 +672,6 @@ The Apache Traffic Server Administration Manual will explain what these strings
  proxy.config.ssl.server.private_key.path
  proxy.config.stat_collector.interval
  proxy.config.stat_collector.port
- proxy.config.stats.snap_file
- proxy.config.stats.snap_frequency
  proxy.config.syslog_facility
  proxy.config.system.mmap_max
  proxy.config.system.file_max_pct

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/lib/records/I_RecCore.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecCore.h b/lib/records/I_RecCore.h
index eb4eb4b..f3a36f7 100644
--- a/lib/records/I_RecCore.h
+++ b/lib/records/I_RecCore.h
@@ -185,8 +185,6 @@ int RecGetRecordSource(const char *name, RecSourceT *source, bool lock = true);
 int RecGetRecordAccessType(const char *name, RecAccessT *secure, bool lock = true);
 int RecSetRecordAccessType(const char *name, RecAccessT secure, bool lock = true);
 
-int RecGetRecordPrefix_Xmalloc(char *prefix, char **result, int *result_len);
-
 //------------------------------------------------------------------------
 // Signal and Alarms
 //------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index 0baf49b..61b5439 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -1010,74 +1010,6 @@ RecDumpRecordsHt(RecT rec_type)
 }
 
 //-------------------------------------------------------------------------
-// RecGetRecordPrefix_Xmalloc
-//
-//     mimics/replaces proxy/StatSystem.cc::stat_callback().
-//     returns the number of variables name match the prefix.
-//-------------------------------------------------------------------------
-int
-RecGetRecordPrefix_Xmalloc(char *prefix, char **buf, int *buf_len)
-{
-  int num_records = g_num_records;
-  int result_size = num_records * 256; /* estimate buffer size */
-  int num_matched = 0;
-  char *result = NULL;
-
-  result = (char *)ats_malloc(result_size * sizeof(char));
-  memset(result, 0, result_size * sizeof(char));
-
-  int i;
-  int total_bytes_written = 0;
-  int error = 0;
-  for (i = 0; !error && i < num_records; i++) {
-    int bytes_written = 0;
-    int bytes_avail = result_size - total_bytes_written;
-    RecRecord *r = &(g_records[i]);
-    if (strncmp(prefix, r->name, strlen(prefix)) == 0) {
-      rec_mutex_acquire(&(r->lock));
-      switch (r->data_type) {
-      case RECD_INT:
-        num_matched++;
-        bytes_written = snprintf(result + total_bytes_written, bytes_avail, "%s=%" PRId64 "\r\n", r->name, r->data.rec_int);
-        break;
-      case RECD_FLOAT:
-        num_matched++;
-        bytes_written = snprintf(result + total_bytes_written, bytes_avail, "%s=%f\r\n", r->name, r->data.rec_float);
-        break;
-      case RECD_STRING:
-        num_matched++;
-        bytes_written = snprintf(result + total_bytes_written, bytes_avail, "%s=%s\r\n", r->name,
-                                 r->data.rec_string ? r->data.rec_string : "NULL");
-        break;
-      case RECD_COUNTER:
-        num_matched++;
-        bytes_written = snprintf(result + total_bytes_written, bytes_avail, "%s=%" PRId64 "\r\n", r->name, r->data.rec_int);
-        break;
-      default:
-        break;
-      }
-
-      if (bytes_written <= 0 || bytes_written > bytes_avail) {
-        error = 1;
-      } else
-        total_bytes_written += bytes_written;
-
-      rec_mutex_release(&(r->lock));
-    }
-  }
-
-  if (error || total_bytes_written == result_size) {
-    RecLog(DL_Error, "Stat system was unable to fully generate stat list, size exceeded limit of %d", result_size);
-  }
-
-  *buf = result;
-  *buf_len = strlen(result);
-
-  return num_matched;
-}
-
-
-//-------------------------------------------------------------------------
 // Backwards compatibility ... TODO: Should eliminate these
 //-------------------------------------------------------------------------
 RecInt

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 51131ad..0e963c9 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1114,12 +1114,6 @@ static const RecordElement RecordsConfig[] =
   //        #########
   //        # Stats #
   //        #########
-  //# frequency is in seconds
-  {RECT_CONFIG, "proxy.config.stats.snap_frequency", RECD_INT, "60", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
-  // Jira TS-21
-  {RECT_CONFIG, "proxy.config.stats.snap_file", RECD_STRING, "stats.snap", RECU_RESTART_TS, RR_NULL, RECC_NULL, NULL, RECA_NULL}
-  ,
   {RECT_CONFIG, "proxy.config.stats.enable_lua", RECD_INT, "0", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
   ,
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/CacheControl.cc
----------------------------------------------------------------------
diff --git a/proxy/CacheControl.cc b/proxy/CacheControl.cc
index c1129ca..842f316 100644
--- a/proxy/CacheControl.cc
+++ b/proxy/CacheControl.cc
@@ -39,7 +39,6 @@
 #include "ProxyConfig.h"
 #include "HTTP.h"
 #include "HttpConfig.h"
-#include "StatSystem.h"
 #include "P_Cache.h"
 #include "ts/Regex.h"
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/DynamicStats.h
----------------------------------------------------------------------
diff --git a/proxy/DynamicStats.h b/proxy/DynamicStats.h
deleted file mode 100644
index 50ba1a4..0000000
--- a/proxy/DynamicStats.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-_HEADER
-//
-// Dynamic http stats
-//
-// this one's in the state machine currently
-//
-//
-// Dynamic Cluster Stats
-//
-_D(cluster_connections_open_stat)
-_D(cluster_connections_openned_stat)
-_D(cluster_con_total_time_stat)
-_D(cluster_ctrl_msgs_sent_stat)
-_D(cluster_slow_ctrl_msgs_sent_stat) // fast ctrl messages do not require a mallo
-_D(cluster_ctrl_msgs_recvd_stat)
-_D(cluster_slow_ctrl_msgs_recvd_stat)
-_D(cluster_ctrl_msgs_send_time_stat)
-_D(cluster_ctrl_msgs_recv_time_stat)
-_D(cluster_read_bytes_stat)
-_D(cluster_write_bytes_stat)
-_D(cluster_op_delayed_for_lock_stat) // a message to a machine was blocked by a locked connection
-_D(cluster_connections_locked_stat)  // a connection could not use its slot (locked)
-_D(cluster_connections_bumped_stat)  // a connection could not get a slot (scheduled too late)
-_D(cluster_nodes_stat)
-_D(cluster_net_backup_stat)
-_D(cluster_machines_allocated_stat)
-_D(cluster_machines_freed_stat)
-_D(cluster_configuration_changes_stat)
-_D(cluster_delayed_reads_stat)
-_D(cluster_byte_bank_used_stat)
-_D(cluster_alloc_data_news_stat)
-_D(cluster_write_bb_mallocs_stat)
-_D(cluster_partial_reads_stat)
-_D(cluster_partial_writes_stat)
-_D(cluster_cache_outstanding_stat)
-_D(cluster_remote_op_timeouts_stat)
-_D(cluster_remote_op_reply_timeouts_stat)
-_D(cluster_chan_inuse_stat)
-_D(cluster_open_delays_stat)
-_D(cluster_open_delay_time_stat)
-_D(cluster_cache_callbacks_stat)
-_D(cluster_cache_callback_time_stat)
-_D(cluster_cache_rmt_callbacks_stat)
-_D(cluster_cache_rmt_callback_time_stat)
-_D(cluster_cache_lkrmt_callbacks_stat)
-_D(cluster_cache_lkrmt_callback_time_stat)
-_D(cluster_thread_steal_expires_stat)
-_D(cluster_local_connections_closed_stat)
-_D(cluster_local_connection_time_stat)
-_D(cluster_remote_connections_closed_stat)
-_D(cluster_remote_connection_time_stat)
-_D(cluster_rdmsg_assemble_time_stat)
-_D(cluster_ping_time_stat)
-_D(cluster_setdata_no_clustervc_stat)
-_D(cluster_setdata_no_tunnel_stat)
-_D(cluster_setdata_no_cachevc_stat)
-_D(cluster_setdata_no_cluster_stat)
-_D(cluster_vc_write_stall_stat)
-_D(cluster_no_remote_space_stat)
-_D(cluster_level1_bank_stat)
-_D(cluster_multilevel_bank_stat)
-_D(cluster_vc_cache_insert_lock_misses_stat)
-_D(cluster_vc_cache_inserts_stat)
-_D(cluster_vc_cache_lookup_lock_misses_stat)
-_D(cluster_vc_cache_lookup_hits_stat)
-_D(cluster_vc_cache_lookup_misses_stat)
-_D(cluster_vc_cache_scans_stat)
-_D(cluster_vc_cache_scan_lock_misses_stat)
-_D(cluster_vc_cache_purges_stat)
-_D(cluster_write_lock_misses_stat)
-
-
-//
-// Dynamic Load Shedding Stats
-//
-_D(cpu_metric_load_percent_stat)
-_D(cpu_metric_net_loops_per_second_stat)
-_D(cpu_metric_fds_ready_per_loop_stat)
-
-_FOOTER

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/IPAllow.cc
----------------------------------------------------------------------
diff --git a/proxy/IPAllow.cc b/proxy/IPAllow.cc
index 20c36d9..4e94029 100644
--- a/proxy/IPAllow.cc
+++ b/proxy/IPAllow.cc
@@ -32,7 +32,6 @@
 #include "Main.h"
 #include "IPAllow.h"
 #include "ProxyConfig.h"
-#include "StatSystem.h"
 #include "P_EventSystem.h"
 #include "P_Cache.h"
 #include "hdrs/HdrToken.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 8373e16..d41c874 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -41,7 +41,6 @@
 #include "P_Net.h"
 #include "P_UDPNet.h"
 #include "P_HostDB.h"
-#include "StatSystem.h"
 #include "P_Cache.h"
 #include "I_RecCore.h"
 #include "I_RecSignals.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/InkAPIInternal.h
----------------------------------------------------------------------
diff --git a/proxy/InkAPIInternal.h b/proxy/InkAPIInternal.h
index 241e177..faa2ea3 100644
--- a/proxy/InkAPIInternal.h
+++ b/proxy/InkAPIInternal.h
@@ -26,7 +26,6 @@
 
 #include "P_EventSystem.h"
 #include "URL.h"
-#include "StatSystem.h"
 #include "P_Net.h"
 #include "ts.h"
 #include "experimental.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index fd66cd5..d72b559 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -57,7 +57,6 @@ extern "C" int plock(int);
 #include "Main.h"
 #include "ts/signals.h"
 #include "Error.h"
-#include "StatSystem.h"
 #include "P_EventSystem.h"
 #include "P_Net.h"
 #include "P_UDPNet.h"
@@ -1072,7 +1071,7 @@ struct ShowStats : public Continuation {
     (void)e;
     if (!(cycle++ % 24))
       printf("r:rr w:ww r:rbs w:wbs open polls\n");
-    ink_statval_t sval, cval;
+    int64_t sval, cval;
 
     NET_READ_DYN_SUM(net_calls_to_readfromnet_stat, sval);
     int64_t d_rb = sval - last_rb;
@@ -1700,9 +1699,6 @@ main(int /* argc ATS_UNUSED */, const char **argv)
   }
   Note("cache clustering %s", cache_clustering_enabled ? "enabled" : "disabled");
 
-  // Initialize New Stat system
-  initialize_all_global_stats();
-
   num_of_net_threads = adjust_num_of_net_threads(num_of_net_threads);
 
   size_t stacksize;
@@ -1819,7 +1815,6 @@ main(int /* argc ATS_UNUSED */, const char **argv)
     // acc.start();
     // pmgmt initialization moved up, needed by RecProcessInit
     // pmgmt->start();
-    start_stats_snap();
 
     // Initialize Response Body Factory
     body_factory = new HttpBodyFactory;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/Makefile.am
----------------------------------------------------------------------
diff --git a/proxy/Makefile.am b/proxy/Makefile.am
index 2b07237..cbd1da4 100644
--- a/proxy/Makefile.am
+++ b/proxy/Makefile.am
@@ -143,7 +143,6 @@ traffic_server_SOURCES = \
   CoreUtils.cc \
   CoreUtils.h \
   Crash.cc \
-  DynamicStats.h \
   EventName.cc \
   FetchSM.cc \
   HttpTransStats.h \
@@ -162,6 +161,7 @@ traffic_server_SOURCES = \
   InkIOCoreAPI.cc \
   Main.cc \
   Main.h \
+  Milestones.h \
   ParentConsistentHash.cc \
   ParentConsistentHash.h \
   ParentRoundRobin.cc \
@@ -181,8 +181,6 @@ traffic_server_SOURCES = \
   SocksProxy.cc \
   StatPages.cc \
   StatPages.h \
-  StatSystem.cc \
-  StatSystem.h \
   Transform.cc \
   Transform.h \
   TransformInternal.h
@@ -286,7 +284,6 @@ traffic_sac_SOURCES = \
   ControlBase.cc \
   ControlMatcher.cc \
   CacheControl.cc \
-  StatSystem.cc \
   ReverseProxy.cc \
   EventName.cc \
   StatPages.cc \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/Milestones.h
----------------------------------------------------------------------
diff --git a/proxy/Milestones.h b/proxy/Milestones.h
new file mode 100644
index 0000000..bc2bcd1
--- /dev/null
+++ b/proxy/Milestones.h
@@ -0,0 +1,76 @@
+/** @file
+
+  A brief file description
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ */
+
+#if !defined(_Milestones_h_)
+#define _Milestones_h_
+
+#include "ts/ink_platform.h"
+#include "ts/ink_hrtime.h"
+#include "ts/apidefs.h"
+
+/////////////////////////////////////////////////////////////
+//
+// class TransactionMilestones
+//
+/////////////////////////////////////////////////////////////
+class TransactionMilestones
+{
+public:
+  TransactionMilestones() { ink_zero(milestones); }
+
+  ink_hrtime &operator[](TSMilestonesType ms) { return milestones[ms]; }
+
+  ink_hrtime operator[](TSMilestonesType ms) const { return milestones[ms]; }
+
+  /**
+   * Takes two milestones and returns the difference.
+   * @param start The start time
+   * @param end The end time
+   * @return A double that is the time in seconds
+   */
+  int64_t
+  difference_msec(TSMilestonesType ms_start, TSMilestonesType ms_end) const
+  {
+    if (milestones[ms_end] == 0) {
+      return -1;
+    }
+    return ink_hrtime_to_msec(milestones[ms_end] - milestones[ms_start]);
+  }
+
+  double
+  difference(TSMilestonesType ms_start, TSMilestonesType ms_end) const
+  {
+    return (double)difference_msec(ms_start, ms_end);
+  }
+
+  ink_hrtime
+  elapsed(TSMilestonesType ms_start, TSMilestonesType ms_end) const
+  {
+    return milestones[ms_end] - milestones[ms_start];
+  }
+
+private:
+  ink_hrtime milestones[TS_MILESTONE_LAST_ENTRY];
+};
+
+#endif /* _Milestones_h_ */

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/ReverseProxy.cc
----------------------------------------------------------------------
diff --git a/proxy/ReverseProxy.cc b/proxy/ReverseProxy.cc
index 7a60af2..4a2e145 100644
--- a/proxy/ReverseProxy.cc
+++ b/proxy/ReverseProxy.cc
@@ -32,7 +32,6 @@
 #include "Main.h"
 #include "Error.h"
 #include "P_EventSystem.h"
-#include "StatSystem.h"
 #include "P_Cache.h"
 #include "ProxyConfig.h"
 #include "ReverseProxy.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/SocksProxy.cc
----------------------------------------------------------------------
diff --git a/proxy/SocksProxy.cc b/proxy/SocksProxy.cc
index 1ff2f78..3354a75 100644
--- a/proxy/SocksProxy.cc
+++ b/proxy/SocksProxy.cc
@@ -28,7 +28,6 @@
 
 */
 #include "ts/ink_platform.h"
-#include "StatSystem.h"
 #include "P_Net.h"
 #include "I_OneWayTunnel.h"
 #include "HttpSessionAccept.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/StatSystem.cc
----------------------------------------------------------------------
diff --git a/proxy/StatSystem.cc b/proxy/StatSystem.cc
deleted file mode 100644
index b237a5e..0000000
--- a/proxy/StatSystem.cc
+++ /dev/null
@@ -1,470 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-/****************************************************************************
-
-  StatSystem.cc --
-  Created On          : Fri Apr 3 19:41:39 1998
- ****************************************************************************/
-#include "Main.h"
-#include "StatSystem.h"
-#include "P_EventSystem.h"
-#include "Error.h"
-#include "ProcessManager.h"
-#include "ProxyConfig.h"
-#include "StatPages.h"
-#include "HTTP.h"
-#include "ts/I_Layout.h"
-
-// defines
-
-#define SNAP_USAGE_PERIOD HRTIME_SECONDS(2)
-
-
-// variables
-
-#ifdef DEBUG
-ink_mutex http_time_lock;
-time_t last_http_local_time;
-#endif
-ink_stat_lock_t global_http_trans_stat_lock;
-ink_unprot_global_stat_t global_http_trans_stats[MAX_HTTP_TRANS_STATS];
-#ifndef USE_LOCKS_FOR_DYN_STATS
-inkcoreapi ink_unprot_global_stat_t global_dyn_stats[MAX_DYN_STATS - DYN_STAT_START];
-#else
-inkcoreapi ink_prot_global_stat_t global_dyn_stats[MAX_DYN_STATS - DYN_STAT_START];
-#endif
-
-Ptr<ProxyMutex> rusage_snap_mutex;
-struct rusage rusage_snap;
-struct rusage rusage_snap_old;
-ink_hrtime rusage_snap_time;
-ink_hrtime rusage_snap_time_old;
-int snap_stats_every = 60;
-
-ink_hrtime http_handler_times[MAX_HTTP_HANDLER_EVENTS];
-int http_handler_counts[MAX_HTTP_HANDLER_EVENTS];
-
-
-char snap_filename[PATH_NAME_MAX] = DEFAULT_SNAP_FILENAME;
-
-#define DEFAULT_PERSISTENT
-
-#ifndef DEFAULT_PERSISTENT
-static int persistent_stats[] = {http_incoming_requests_stat};
-#else
-static int non_persistent_stats[] = {
-  ////////////////////////////
-  // Start of Cluster stats
-  ////////////////////////////
-  cluster_connections_open_stat, cluster_connections_openned_stat, cluster_con_total_time_stat, cluster_ctrl_msgs_sent_stat,
-  cluster_slow_ctrl_msgs_sent_stat, cluster_ctrl_msgs_recvd_stat, cluster_slow_ctrl_msgs_recvd_stat,
-  cluster_ctrl_msgs_send_time_stat, cluster_ctrl_msgs_recv_time_stat, cluster_read_bytes_stat, cluster_write_bytes_stat,
-  cluster_op_delayed_for_lock_stat, cluster_connections_locked_stat, cluster_connections_bumped_stat, cluster_nodes_stat,
-  cluster_net_backup_stat, cluster_machines_allocated_stat, cluster_machines_freed_stat, cluster_configuration_changes_stat,
-  cluster_delayed_reads_stat, cluster_byte_bank_used_stat, cluster_alloc_data_news_stat, cluster_write_bb_mallocs_stat,
-  cluster_partial_reads_stat, cluster_partial_writes_stat, cluster_cache_outstanding_stat, cluster_remote_op_timeouts_stat,
-  cluster_remote_op_reply_timeouts_stat, cluster_chan_inuse_stat, cluster_open_delays_stat, cluster_open_delay_time_stat,
-  cluster_cache_callbacks_stat, cluster_cache_callback_time_stat, cluster_cache_rmt_callbacks_stat,
-  cluster_cache_rmt_callback_time_stat, cluster_cache_lkrmt_callbacks_stat, cluster_cache_lkrmt_callback_time_stat,
-  cluster_thread_steal_expires_stat, cluster_local_connections_closed_stat, cluster_local_connection_time_stat,
-  cluster_remote_connections_closed_stat, cluster_remote_connection_time_stat, cluster_rdmsg_assemble_time_stat,
-  cluster_ping_time_stat, cluster_setdata_no_clustervc_stat, cluster_setdata_no_tunnel_stat, cluster_setdata_no_cachevc_stat,
-  cluster_setdata_no_cluster_stat, cluster_vc_write_stall_stat, cluster_no_remote_space_stat, cluster_level1_bank_stat,
-  cluster_multilevel_bank_stat, cluster_vc_cache_insert_lock_misses_stat, cluster_vc_cache_inserts_stat,
-  cluster_vc_cache_lookup_lock_misses_stat, cluster_vc_cache_lookup_hits_stat, cluster_vc_cache_lookup_misses_stat,
-  cluster_vc_cache_scans_stat, cluster_vc_cache_scan_lock_misses_stat, cluster_vc_cache_purges_stat, cluster_write_lock_misses_stat,
-  /////////////////////////////////////
-  // Start of Scheduled Update stats
-  /////////////////////////////////////
-  // DNS
-  // dns_success_time_stat
-};
-#endif
-
-#define _HEADER DynamicStatsString_t DynamicStatsStrings[] = {
-#define _FOOTER \
-  }             \
-  ;
-#define _D(_x) \
-  {            \
-    _x, #_x    \
-  }            \
-  ,
-
-#include "DynamicStats.h"
-#undef _HEADER
-#undef _FOOTER
-#undef _D
-
-
-// functions
-
-static int
-persistent_stat(int i)
-{
-#ifndef DEFAULT_PERSISTENT
-  for (unsigned j = 0; j < countof(persistent_stats); j++)
-    if (persistent_stats[j] == i)
-      return 1;
-  return 0;
-#else
-  for (unsigned j = 0; j < countof(non_persistent_stats); j++)
-    if (non_persistent_stats[j] == i)
-      return 0;
-  return 1;
-#endif
-}
-
-static int
-open_stats_snap()
-{
-  int fd = socketManager.open(snap_filename, O_CREAT | O_RDWR);
-  if (fd < 0) {
-    Warning("unable to open %s: %s", snap_filename, strerror(-fd));
-    return -1;
-  }
-  return fd;
-}
-
-static void
-clear_stats()
-{
-  int i = 0;
-
-  int stats_size = MAX_HTTP_TRANS_STATS - NO_HTTP_TRANS_STATS - 1;
-  for (i = 0; i < stats_size; i++) {
-    if (persistent_stat(i + NO_HTTP_TRANS_STATS)) {
-      global_http_trans_stats[i].sum = 0;
-      global_http_trans_stats[i].count = 0;
-    }
-  }
-  stats_size = MAX_DYN_STATS - NO_DYN_STATS - 1;
-  for (i = 0; i < stats_size; i++) {
-    if (persistent_stat(i + NO_DYN_STATS)) {
-      global_dyn_stats[i].sum = 0;
-      global_dyn_stats[i].count = 0;
-    }
-  }
-
-  socketManager.unlink(snap_filename);
-  Debug("stats", "clear_stats: clearing statistics");
-}
-
-static void
-read_stats_snap()
-{
-  unsigned int version;
-  unsigned int version_read;
-  int count;
-  int fd = -1;
-  int i = 0;
-  int stats_size = -1;
-
-  version = STATS_MAJOR_VERSION;
-
-  if ((fd = open_stats_snap()) < 0)
-    goto Lmissmatch;
-
-  // read and verify snap
-  if (socketManager.read(fd, (char *)&version_read, sizeof(version_read)) != sizeof(version_read))
-    goto Lmissmatch;
-  if (version != version_read)
-    goto Lmissmatch;
-  stats_size = MAX_HTTP_TRANS_STATS - NO_HTTP_TRANS_STATS + MAX_DYN_STATS - NO_DYN_STATS;
-  if (socketManager.read(fd, (char *)&count, sizeof(count)) != sizeof(count))
-    goto Lmissmatch;
-  if (count != stats_size)
-    goto Lmissmatch;
-
-  stats_size = MAX_HTTP_TRANS_STATS - NO_HTTP_TRANS_STATS;
-  for (i = 0; i < stats_size; i++) {
-    if (socketManager.read(fd, (char *)&global_http_trans_stats[i].sum, sizeof(global_http_trans_stats[i].sum)) !=
-        sizeof(global_http_trans_stats[i].sum))
-      goto Lmissmatch;
-    if (socketManager.read(fd, (char *)&global_http_trans_stats[i].count, sizeof(global_http_trans_stats[i].count)) !=
-        sizeof(global_http_trans_stats[i].count))
-      goto Lmissmatch;
-  }
-  stats_size = MAX_DYN_STATS - NO_DYN_STATS;
-  for (i = 0; i < stats_size; i++) {
-    if (socketManager.read(fd, (char *)&global_dyn_stats[i].sum, sizeof(global_dyn_stats[i].sum)) !=
-        sizeof(global_dyn_stats[i].sum))
-      goto Lmissmatch;
-    if (socketManager.read(fd, (char *)&global_dyn_stats[i].count, sizeof(global_dyn_stats[i].count)) !=
-        sizeof(global_dyn_stats[i].count))
-      goto Lmissmatch;
-  }
-  Debug("stats", "read_stats_snap: read statistics");
-
-  // close(fd);
-  socketManager.close(fd);
-  return;
-
-Lmissmatch:
-  Note("clearing statistics");
-  clear_stats();
-  // close(fd);
-  socketManager.close(fd);
-}
-
-static void
-write_stats_snap()
-{
-  int fd = 0;
-  int version = STATS_MAJOR_VERSION;
-  char *buf = NULL;
-
-  if ((fd = open_stats_snap()) < 0) {
-    Warning("unable to snap statistics");
-    return;
-  }
-
-  {
-    int stats_size = MAX_HTTP_TRANS_STATS - NO_HTTP_TRANS_STATS + MAX_DYN_STATS - NO_DYN_STATS;
-    int buf_size = sizeof(unsigned int) * 3 + stats_size * (sizeof(global_dyn_stats[0].sum) + sizeof(global_dyn_stats[0].count));
-    buf = (char *)ats_malloc(buf_size);
-    char *p = buf;
-    int i = 0;
-
-    memcpy(p, (char *)&version, sizeof(version));
-    p += sizeof(version);
-    memcpy(p, (char *)&stats_size, sizeof(stats_size));
-    p += sizeof(stats_size);
-
-    stats_size = MAX_HTTP_TRANS_STATS - NO_HTTP_TRANS_STATS;
-    STAT_LOCK_ACQUIRE(&(global_http_trans_stat_lock));
-    for (i = 0; i < stats_size; i++) {
-      memcpy(p, (char *)&global_http_trans_stats[i].sum, sizeof(global_http_trans_stats[i].sum));
-      p += sizeof(global_http_trans_stats[i].sum);
-      memcpy(p, (char *)&global_http_trans_stats[i].count, sizeof(global_http_trans_stats[i].count));
-      p += sizeof(global_http_trans_stats[i].count);
-    }
-    STAT_LOCK_RELEASE(&(global_http_trans_stat_lock));
-    stats_size = MAX_DYN_STATS - NO_DYN_STATS;
-    for (i = 0; i < stats_size; i++) {
-      // INKqa09981 (Clearing Host Database and DNS Statistics)
-      ink_statval_t count, sum;
-      READ_GLOBAL_DYN_STAT(i, count, sum);
-      memcpy(p, (char *)&sum, sizeof(sum));
-      p += sizeof(sum);
-      memcpy(p, (char *)&count, sizeof(count));
-      p += sizeof(count);
-    }
-    memcpy(p, (char *)&version, sizeof(version));
-
-    if (socketManager.write(fd, buf, buf_size) != buf_size) {
-      Warning("unable to snap statistics");
-      ats_free(buf);
-      socketManager.close(fd);
-      return;
-    }
-  }
-  ats_free(buf);
-  socketManager.close(fd);
-  Debug("stats", "snapped stats");
-}
-
-struct SnapStatsContinuation : public Continuation {
-  int
-  mainEvent(int /* event ATS_UNUSED */, Event *e ATS_UNUSED)
-  {
-    write_stats_snap();
-    e->schedule_every(HRTIME_SECONDS(snap_stats_every));
-    return EVENT_CONT;
-  }
-  SnapStatsContinuation() : Continuation(new_ProxyMutex()) { SET_HANDLER(&SnapStatsContinuation::mainEvent); }
-};
-
-static void
-take_rusage_snap()
-{
-  rusage_snap_old = rusage_snap;
-  rusage_snap_time_old = rusage_snap_time;
-  int retries = 3;
-  while (retries--) {
-    if (getrusage(RUSAGE_SELF, &rusage_snap) < 0) {
-      if (errno == EINTR)
-        continue;
-      Note("getrusage [%d %s]", errno, strerror(errno));
-    } else
-      rusage_snap_time = Thread::get_hrtime();
-    break;
-  }
-  Debug("rusage", "took rusage snap %" PRId64 "", rusage_snap_time);
-}
-
-struct SnapCont;
-typedef int (SnapCont::*SnapContHandler)(int, void *);
-
-struct SnapCont : public Continuation {
-  int
-  mainEvent(int /* event ATS_UNUSED */, Event *e)
-  {
-    take_rusage_snap();
-    e->schedule_every(SNAP_USAGE_PERIOD);
-    return EVENT_CONT;
-  }
-  SnapCont(ProxyMutex *m) : Continuation(m) { SET_HANDLER((SnapContHandler)&SnapCont::mainEvent); }
-};
-
-void
-start_stats_snap()
-{
-  eventProcessor.schedule_every(new SnapCont(rusage_snap_mutex), SNAP_USAGE_PERIOD, ET_CALL);
-  if (snap_stats_every)
-    eventProcessor.schedule_every(new SnapStatsContinuation(), HRTIME_SECONDS(snap_stats_every), ET_CALL);
-  else
-    Warning("disabling statistics snap");
-}
-
-static Action *
-stat_callback(Continuation *cont, HTTPHdr *header)
-{
-  URL *url;
-  int length;
-  const char *path;
-  char *result = NULL;
-  int result_size;
-  bool empty;
-
-  url = header->url_get();
-  path = url->path_get(&length);
-
-  char *buffer = NULL;
-  int buffer_len = 0;
-  int num_prefix_buffer;
-
-  char *var_prefix = (char *)alloca((length + 1) * sizeof(char));
-
-  memset(var_prefix, 0, ((length + 1) * sizeof(char)));
-  if (path && length > 0)
-    ink_strlcpy(var_prefix, path, length + 1);
-
-  num_prefix_buffer = RecGetRecordPrefix_Xmalloc(var_prefix, &buffer, &buffer_len);
-  empty = (num_prefix_buffer == 0);
-
-  if (!empty) {
-    result_size = (buffer_len + 16) * sizeof(char);
-    result = (char *)ats_malloc(result_size);
-    memset(result, 0, result_size);
-
-    snprintf(result, result_size - 7, "<pre>\n%s", buffer);
-  }
-
-
-  if (!empty) {
-    StatPageData data;
-
-    ink_strlcat(result, "</pre>\n", result_size);
-
-    data.data = result;
-    data.length = strlen(result);
-    cont->handleEvent(STAT_PAGE_SUCCESS, &data);
-  } else {
-    ats_free(result);
-    cont->handleEvent(STAT_PAGE_FAILURE, NULL);
-  }
-  ats_free(buffer);
-
-  return ACTION_RESULT_DONE;
-}
-
-static Action *
-testpage_callback(Continuation *cont, HTTPHdr *)
-{
-  const int buf_size = 64000;
-  char *buffer = (char *)ats_malloc(buf_size);
-
-  for (int i = 0; i < buf_size; i++) {
-    buffer[i] = (char)('a' + (i % 26));
-  }
-  buffer[buf_size - 1] = '\0';
-
-  StatPageData data;
-
-  data.data = buffer;
-  data.length = strlen(buffer);
-  cont->handleEvent(STAT_PAGE_SUCCESS, &data);
-
-  return ACTION_RESULT_DONE;
-}
-
-static void
-testpage_callback_init()
-{
-  statPagesManager.register_http("test", testpage_callback);
-}
-
-void
-initialize_all_global_stats()
-{
-  int istat, i;
-  char snap_file[PATH_NAME_MAX];
-  ats_scoped_str rundir(RecConfigReadRuntimeDir());
-
-  if (access(rundir, R_OK | W_OK) == -1) {
-    Warning("Unable to access() local state directory '%s': %d, %s", (const char *)rundir, errno, strerror(errno));
-    Warning(" Please set 'proxy.config.local_state_dir' to allow statistics collection");
-  }
-  REC_ReadConfigString(snap_file, "proxy.config.stats.snap_file", PATH_NAME_MAX);
-  Layout::relative_to(snap_filename, sizeof(snap_filename), (const char *)rundir, snap_file);
-  Debug("stats", "stat snap filename %s", snap_filename);
-
-  statPagesManager.register_http("stat", stat_callback);
-
-  testpage_callback_init();
-
-  read_stats_snap();
-  rusage_snap_mutex = new_ProxyMutex();
-  take_rusage_snap();
-  take_rusage_snap(); // fill in _old as well
-
-  STAT_LOCK_INIT(&(global_http_trans_stat_lock), "Global Http Stats Lock");
-
-  for (istat = NO_HTTP_TRANS_STATS; istat < MAX_HTTP_TRANS_STATS; istat++) {
-    if (!persistent_stat(istat)) {
-      INITIALIZE_GLOBAL_TRANS_STATS(global_http_trans_stats[istat]);
-    }
-  }
-
-  for (istat = NO_DYN_STATS; istat < MAX_DYN_STATS; istat++) {
-    if (!persistent_stat(istat)) {
-      i = istat - DYN_STAT_START;
-      INITIALIZE_GLOBAL_DYN_STATS(global_dyn_stats[i], "Dyn Stat Lock");
-    }
-  }
-
-// TODO: HMMMM, wtf does this do? The following is that this
-// function does:
-// ink_atomic_swap(&this->f_update_lock, (void *) func)
-//
-// pmgmt->record_data->registerUpdateLockFunc(tmp_stats_lock_function);
-
-#ifdef DEBUG
-  ink_mutex_init(&http_time_lock, "Http Time Function Lock");
-  last_http_local_time = 0;
-#endif
-
-  clear_http_handler_times();
-}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/StatSystem.h
----------------------------------------------------------------------
diff --git a/proxy/StatSystem.h b/proxy/StatSystem.h
deleted file mode 100644
index 16a3248..0000000
--- a/proxy/StatSystem.h
+++ /dev/null
@@ -1,587 +0,0 @@
-/** @file
-
-  A brief file description
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-/****************************************************************************
-
-  StatSystem.h --
-  Created On          : Fri Apr 3 19:41:39 1998
- ****************************************************************************/
-#if !defined(_StatSystem_h_)
-#define _StatSystem_h_
-
-#include "ts/ink_platform.h"
-#include "ts/ink_memory.h"
-#include "ts/ink_hrtime.h"
-#include "ts/ink_atomic.h"
-
-#ifdef USE_LOCKS_FOR_DYN_STATS
-#include "Lock.h"
-#endif
-
-#include "ts/ink_apidefs.h"
-#include "ts/apidefs.h"
-
-#define STATS_MAJOR_VERSION 6 // increment when changing the stats!
-#define DEFAULT_SNAP_FILENAME "stats.snap"
-
-/////////////////////////////////////////////////////////////
-//
-// class TransactionMilestones
-//
-/////////////////////////////////////////////////////////////
-class TransactionMilestones
-{
-public:
-  TransactionMilestones() { ink_zero(milestones); }
-
-  ink_hrtime &operator[](TSMilestonesType ms) { return milestones[ms]; }
-
-  ink_hrtime operator[](TSMilestonesType ms) const { return milestones[ms]; }
-
-  /**
-   * Takes two milestones and returns the difference.
-   * @param start The start time
-   * @param end The end time
-   * @return A double that is the time in seconds
-   */
-  int64_t
-  difference_msec(TSMilestonesType ms_start, TSMilestonesType ms_end) const
-  {
-    if (milestones[ms_end] == 0) {
-      return -1;
-    }
-    return (milestones[ms_end] - milestones[ms_start]) / 1000000;
-  }
-
-  double
-  difference(TSMilestonesType ms_start, TSMilestonesType ms_end) const
-  {
-    if (milestones[ms_end] == 0) {
-      return -1;
-    }
-    return (double)(milestones[ms_end] - milestones[ms_start]) / 1000000000;
-  }
-
-  ink_hrtime
-  elapsed(TSMilestonesType ms_start, TSMilestonesType ms_end) const
-  {
-    return milestones[ms_end] - milestones[ms_start];
-  }
-
-private:
-  ink_hrtime milestones[TS_MILESTONE_LAST_ENTRY];
-};
-
-// Modularization Project: Build w/o thread-local-dyn-stats
-// temporarily until we switch over to librecords.  Revert to old
-// non-thread-local system so that TS will still build and run.
-
-//---------------------------------------------------------------------//
-//                       Welcome to enum land!                         //
-//---------------------------------------------------------------------//
-
-// Before adding a stat variable, decide whether it is of
-// a "transaction" type or if it is of a "dynamic" type.
-// Then add the stat variable to the appropriate enumeration
-// type. Make sure that DYN_STAT_START is large enough
-// (read comment below).
-
-//
-// Http Transaction Stats
-//
-#define _HEADER typedef enum { NO_HTTP_TRANS_STATS = 0,
-
-#define _FOOTER        \
-  MAX_HTTP_TRANS_STATS \
-  }                    \
-  HttpTransactionStat_t;
-
-#if defined(freebsd)
-#undef _D
-#endif
-#define _D(_x) _x,
-
-#include "HttpTransStats.h"
-#undef _HEADER
-#undef _FOOTER
-#undef _D
-
-struct HttpTransactionStatsString_t {
-  HttpTransactionStat_t i;
-  char *name;
-};
-
-//
-// Note: DYN_STAT_START needs to be at least the next
-// power of 2 bigger than the value of MAX_HTTP_TRANS_STATS
-//
-#define DYN_STAT_START 2048
-#define DYN_STAT_MASK (~(2047UL))
-//
-// Dynamic Stats
-//
-#define _HEADER typedef enum { NO_DYN_STATS = DYN_STAT_START,
-
-#define _FOOTER \
-  MAX_DYN_STATS \
-  }             \
-  DynamicStat_t;
-
-#define _D(_x) _x,
-
-#include "DynamicStats.h"
-
-#undef _HEADER
-#undef _FOOTER
-#undef _D
-
-struct DynamicStatsString_t {
-  DynamicStat_t i;
-  const char *name;
-};
-
-extern HttpTransactionStatsString_t HttpTransactionStatsStrings[];
-extern DynamicStatsString_t DynamicStatsStrings[];
-
-//---------------------------------------------------------------------//
-//                          Typedefs, etc.                             //
-//---------------------------------------------------------------------//
-
-// For now, use mutexes. May later change to spin_locks, try_locks.
-#define ink_stat_lock_t ink_mutex
-
-typedef int64_t ink_statval_t;
-
-struct ink_local_stat_t {
-  ink_statval_t count;
-  ink_statval_t value;
-};
-
-struct ink_prot_global_stat_t {
-  ink_stat_lock_t access_lock;
-  ink_statval_t count;
-  ink_statval_t sum;
-
-  ink_prot_global_stat_t() : count(0), sum(0) { ink_mutex_init(&access_lock, "Stats Access Lock"); }
-};
-
-struct ink_unprot_global_stat_t {
-  ink_statval_t count;
-  ink_statval_t sum;
-  ink_unprot_global_stat_t() : count(0), sum(0) {}
-};
-
-
-//---------------------------------------------------------------------//
-//                     External interface macros                       //
-//---------------------------------------------------------------------//
-
-// Set count and sum to 0.
-#define CLEAR_DYN_STAT(X)                      \
-  {                                            \
-    ink_assert(X &DYN_STAT_MASK);              \
-    CLEAR_GLOBAL_DYN_STAT(X - DYN_STAT_START); \
-  }
-
-#define DECREMENT_DYN_STAT(X) SUM_DYN_STAT(X, (ink_statval_t)-1)
-
-#define COUNT_DYN_STAT(X, C)                          \
-  {                                                   \
-    ink_assert(X &DYN_STAT_MASK);                     \
-    ADD_TO_GLOBAL_DYN_COUNT((X - DYN_STAT_START), C); \
-  }
-
-#define FSUM_DYN_STAT(X, S)                          \
-  {                                                  \
-    ink_assert(X &DYN_STAT_MASK);                    \
-    ADD_TO_GLOBAL_DYN_FSUM((X - DYN_STAT_START), S); \
-  }
-
-// Increment the count, sum.
-#define INCREMENT_DYN_STAT(X) SUM_DYN_STAT(X, (ink_statval_t)1)
-
-// Get the count and sum in a single lock acquire operation.
-// Would it make sense to have three functions - a combined
-// read of the count and sum, and two more functions - one
-// to read just the count and the other to read just the sum?
-#define READ_DYN_STAT(X, C, S)                        \
-  {                                                   \
-    ink_assert(X &DYN_STAT_MASK);                     \
-    READ_GLOBAL_DYN_STAT((X - DYN_STAT_START), C, S); \
-  }
-
-#define READ_DYN_COUNT(X, C)                        \
-  {                                                 \
-    ink_assert(X &DYN_STAT_MASK);                   \
-    READ_GLOBAL_DYN_COUNT((X - DYN_STAT_START), C); \
-  }
-
-#define READ_DYN_SUM(X, S)                        \
-  {                                               \
-    ink_assert(X &DYN_STAT_MASK);                 \
-    READ_GLOBAL_DYN_SUM((X - DYN_STAT_START), S); \
-  }
-
-// set the stat.count to a specific value
-#define SET_DYN_COUNT(X, V)                        \
-  {                                                \
-    ink_assert(X &DYN_STAT_MASK);                  \
-    SET_GLOBAL_DYN_COUNT((X - DYN_STAT_START), V); \
-  }
-
-// set the stat.count stat.sum to specific values
-#define SET_DYN_STAT(X, C, S)                        \
-  {                                                  \
-    ink_assert(X &DYN_STAT_MASK);                    \
-    SET_GLOBAL_DYN_STAT((X - DYN_STAT_START), C, S); \
-  }
-
-// Add a specific value to the sum.
-#define SUM_DYN_STAT(X, S)                          \
-  {                                                 \
-    ink_assert(X &DYN_STAT_MASK);                   \
-    ADD_TO_GLOBAL_DYN_SUM((X - DYN_STAT_START), S); \
-  }
-
-// Add a specific value to the sum.
-#define SUM_GLOBAL_DYN_STAT(X, S)                          \
-  {                                                        \
-    ink_assert(X &DYN_STAT_MASK);                          \
-    ADD_TO_GLOBAL_GLOBAL_DYN_SUM((X - DYN_STAT_START), S); \
-  }
-
-#define __CLEAR_TRANS_STAT(local_stat_struct_, X)   \
-  {                                                 \
-    ink_assert(!(X & DYN_STAT_MASK));               \
-    local_stat_struct_[X].count = (ink_statval_t)0; \
-    local_stat_struct_[X].value = (ink_statval_t)0; \
-  }
-
-#define __DECREMENT_TRANS_STAT(local_stat_struct_, X) __SUM_TRANS_STAT(local_stat_struct_, X, (ink_statval_t)-1)
-
-#define __FSUM_TRANS_STAT(local_stat_struct_, X, S) \
-  {                                                 \
-    ink_assert(!(X & DYN_STAT_MASK));               \
-    local_stat_struct_[X].count++;                  \
-    (*(double *)&local_stat_struct_[X].value) += S; \
-  }
-
-// Increment the count, sum.
-#define __INCREMENT_TRANS_STAT(local_stat_struct_, X) __SUM_TRANS_STAT(local_stat_struct_, X, (ink_statval_t)1);
-
-#define __INITIALIZE_LOCAL_STAT_STRUCT(local_stat_struct_, X) __CLEAR_TRANS_STAT(local_stat_struct_, X)
-
-#define INITIALIZE_GLOBAL_TRANS_STATS(X) \
-  {                                      \
-    X.count = (ink_statval_t)0;          \
-    X.sum = (ink_statval_t)0;            \
-  }
-
-// Get the count and sum in a single lock acquire operation.
-// Would it make sense to have three functions - a combined
-// read of the count and sum, and two more functions - one
-// to read just the count and the other to read just the sum?
-#define READ_HTTP_TRANS_STAT(X, C, S)     \
-  {                                       \
-    ink_assert(!(X & DYN_STAT_MASK));     \
-    READ_GLOBAL_HTTP_TRANS_STAT(X, C, S); \
-  }
-
-// set the stat.count to a specific value
-#define __SET_TRANS_COUNT(local_stat_struct_, X, V) \
-  {                                                 \
-    ink_assert(!(X & DYN_STAT_MASK));               \
-    local_stat_struct_[X].value = (ink_statval_t)V; \
-  }
-
-// set the stat.count and the stat.sum to specific values
-#define __SET_TRANS_STAT(local_stat_struct_, X, C, S) \
-  {                                                   \
-    ink_assert(!(X & DYN_STAT_MASK));                 \
-    local_stat_struct_[X].value = (ink_statval_t)S;   \
-  }
-
-// Add a specific value to local stat.
-// Both ADD_TO_SUM_STAT and ADD_TO_COUNT_STAT do the same thing
-// to the local copy of the transaction stat.
-#define __SUM_TRANS_STAT(local_stat_struct_, X, S) \
-  {                                                \
-    ink_assert(!(X & DYN_STAT_MASK));              \
-    local_stat_struct_[X].count += 1;              \
-    local_stat_struct_[X].value += S;              \
-  }
-
-#define UPDATE_HTTP_TRANS_STATS(local_stat_struct_)                    \
-  {                                                                    \
-    int i;                                                             \
-    STAT_LOCK_ACQUIRE(&(global_http_trans_stat_lock));                 \
-    for (i = NO_HTTP_TRANS_STATS; i < MAX_HTTP_TRANS_STATS; i++) {     \
-      global_http_trans_stats[i].count += local_stat_struct_[i].count; \
-      global_http_trans_stats[i].sum += local_stat_struct_[i].value;   \
-    }                                                                  \
-    STAT_LOCK_RELEASE(&(global_http_trans_stat_lock));                 \
-  }
-
-#define STAT_LOCK_ACQUIRE(X) (ink_mutex_acquire(X))
-#define STAT_LOCK_RELEASE(X) (ink_mutex_release(X))
-#define STAT_LOCK_INIT(X, S) (ink_mutex_init(X, S))
-
-//---------------------------------------------------------------------//
-// Internal macros to support adding, setting, reading, clearing, etc. //
-//---------------------------------------------------------------------//
-
-#ifndef USE_LOCKS_FOR_DYN_STATS
-
-#ifdef USE_THREAD_LOCAL_DYN_STATS
-// Modularization Project: See note above
-#error "Should not build with USE_THREAD_LOCAL_DYN_STATS"
-
-
-#define ADD_TO_GLOBAL_DYN_COUNT(X, C) mutex->thread_holding->global_dyn_stats[X].count += (C)
-
-#define ADD_TO_GLOBAL_DYN_SUM(X, S)                   \
-  mutex->thread_holding->global_dyn_stats[X].count++; \
-  mutex->thread_holding->global_dyn_stats[X].sum += (S)
-
-#define ADD_TO_GLOBAL_GLOBAL_DYN_SUM(X, S)                            \
-  ink_atomic_increment(&global_dyn_stats[X].count, (ink_statval_t)1); \
-  ink_atomic_increment(&global_dyn_stats[X].sum, S)
-/*
- * global_dyn_stats[X].count ++; \
- * global_dyn_stats[X].sum += (S)
- */
-
-#define ADD_TO_GLOBAL_DYN_FSUM(X, S)                  \
-  mutex->thread_holding->global_dyn_stats[X].count++; \
-  mutex->thread_holding->global_dyn_stats[X].sum += (S)
-
-#define CLEAR_GLOBAL_DYN_STAT(X) \
-  global_dyn_stats[X].count = 0; \
-  global_dyn_stats[X].sum = 0
-
-#define READ_GLOBAL_DYN_STAT(X, C, S)                                         \
-  do {                                                                        \
-    ink_unprot_global_stat_t _s = global_dyn_stats[X];                        \
-    for (int _e = 0; _e < eventProcessor.n_ethreads; _e++) {                  \
-      _s.count += eventProcessor.all_ethreads[_e]->global_dyn_stats[X].count; \
-      _s.sum += eventProcessor.all_ethreads[_e]->global_dyn_stats[X].sum;     \
-    }                                                                         \
-    for (int _e = 0; _e < eventProcessor.n_dthreads; _e++) {                  \
-      _s.count += eventProcessor.all_dthreads[_e]->global_dyn_stats[X].count; \
-      _s.sum += eventProcessor.all_dthreads[_e]->global_dyn_stats[X].sum;     \
-    }                                                                         \
-    C = _s.count;                                                             \
-    S = _s.sum;                                                               \
-  } while (0)
-
-#define READ_GLOBAL_DYN_COUNT(X, C)                                     \
-  do {                                                                  \
-    ink_statval_t _s = global_dyn_stats[X].count;                       \
-    for (int _e = 0; _e < eventProcessor.n_ethreads; _e++)              \
-      _s += eventProcessor.all_ethreads[_e]->global_dyn_stats[X].count; \
-    for (int _e = 0; _e < eventProcessor.n_dthreads; _e++)              \
-      _s += eventProcessor.all_dthreads[_e]->global_dyn_stats[X].count; \
-    C = _s;                                                             \
-  } while (0)
-
-#define READ_GLOBAL_DYN_SUM(X, S)                                     \
-  do {                                                                \
-    ink_statval_t _s = global_dyn_stats[X].sum;                       \
-    for (int _e = 0; _e < eventProcessor.n_ethreads; _e++)            \
-      _s += eventProcessor.all_ethreads[_e]->global_dyn_stats[X].sum; \
-    for (int _e = 0; _e < eventProcessor.n_dthreads; _e++)            \
-      _s += eventProcessor.all_dthreads[_e]->global_dyn_stats[X].sum; \
-    S = _s;                                                           \
-  } while (0)
-
-#define READ_GLOBAL_HTTP_TRANS_STAT(X, C, S) \
-  {                                          \
-    C = global_http_trans_stats[X].count;    \
-    S = global_http_trans_stats[X].sum;      \
-  }
-
-#define SET_GLOBAL_DYN_COUNT(X, V) global_dyn_stats[X].count = V
-
-#define SET_GLOBAL_DYN_STAT(X, C, S) \
-  global_dyn_stats[X].count = C;     \
-  global_dyn_stats[X].sum = S
-
-#define INITIALIZE_GLOBAL_DYN_STATS(X, T) \
-  {                                       \
-    X.count = (ink_statval_t)0;           \
-    X.sum = (ink_statval_t)0;             \
-  }
-
-#else
-
-#define ADD_TO_GLOBAL_DYN_COUNT(X, C) ink_atomic_increment(&global_dyn_stats[X].count, C)
-
-#define ADD_TO_GLOBAL_DYN_SUM(X, S)                                   \
-  ink_atomic_increment(&global_dyn_stats[X].count, (ink_statval_t)1); \
-  ink_atomic_increment(&global_dyn_stats[X].sum, S)
-
-#define ADD_TO_GLOBAL_GLOBAL_DYN_SUM(X, S)                            \
-  ink_atomic_increment(&global_dyn_stats[X].count, (ink_statval_t)1); \
-  ink_atomic_increment(&global_dyn_stats[X].sum, S)
-
-#define ADD_TO_GLOBAL_DYN_FSUM(X, S)                                  \
-  ink_atomic_increment(&global_dyn_stats[X].count, (ink_statval_t)1); \
-  (*(double *)&global_dyn_stats[X].sum) += S
-
-#define CLEAR_GLOBAL_DYN_STAT(X) \
-  global_dyn_stats[X].count = 0; \
-  global_dyn_stats[X].sum = 0
-
-#define READ_GLOBAL_DYN_STAT(X, C, S) \
-  C = global_dyn_stats[X].count;      \
-  S = global_dyn_stats[X].sum
-
-#define READ_GLOBAL_DYN_COUNT(X, C) C = global_dyn_stats[X].count;
-
-#define READ_GLOBAL_DYN_SUM(X, S) S = global_dyn_stats[X].sum;
-
-#define READ_GLOBAL_HTTP_TRANS_STAT(X, C, S) \
-  {                                          \
-    C = global_http_trans_stats[X].count;    \
-    S = global_http_trans_stats[X].sum;      \
-  }
-
-#define SET_GLOBAL_DYN_COUNT(X, V) global_dyn_stats[X].count = V
-
-#define SET_GLOBAL_DYN_STAT(X, C, S) \
-  global_dyn_stats[X].count = C;     \
-  global_dyn_stats[X].sum = S
-
-#define INITIALIZE_GLOBAL_DYN_STATS(X, T) \
-  {                                       \
-    X.count = (ink_statval_t)0;           \
-    X.sum = (ink_statval_t)0;             \
-  }
-
-#endif /* USE_THREAD_LOCAL_DYN_STATS */
-
-#else /* USE_LOCKS_FOR_DYN_STATS */
-
-#define ADD_TO_GLOBAL_DYN_COUNT(X, C)                      \
-  {                                                        \
-    STAT_LOCK_ACQUIRE(&(global_dyn_stats[X].access_lock)); \
-    global_dyn_stats[X].count += C;                        \
-    STAT_LOCK_RELEASE(&(global_dyn_stats[X].access_lock)); \
-  }
-#define ADD_TO_GLOBAL_DYN_SUM(X, S)                        \
-  {                                                        \
-    STAT_LOCK_ACQUIRE(&(global_dyn_stats[X].access_lock)); \
-    global_dyn_stats[X].count += 1;                        \
-    global_dyn_stats[X].sum += S;                          \
-    STAT_LOCK_RELEASE(&(global_dyn_stats[X].access_lock)); \
-  }
-#define ADD_TO_GLOBAL_GLOBAL_DYN_SUM(X, S)                 \
-  {                                                        \
-    STAT_LOCK_ACQUIRE(&(global_dyn_stats[X].access_lock)); \
-    global_dyn_stats[X].count += 1;                        \
-    global_dyn_stats[X].sum += S;                          \
-    STAT_LOCK_RELEASE(&(global_dyn_stats[X].access_lock)); \
-  }
-#define ADD_TO_GLOBAL_DYN_FSUM(X, S)                       \
-  {                                                        \
-    STAT_LOCK_ACQUIRE(&(global_dyn_stats[X].access_lock)); \
-    global_dyn_stats[X].count += (ink_statval_t)1;         \
-    (*(double *)&global_dyn_stats[X].sum) += S;            \
-    STAT_LOCK_RELEASE(&(global_dyn_stats[X].access_lock)); \
-  }
-#define CLEAR_GLOBAL_DYN_STAT(X)                           \
-  {                                                        \
-    STAT_LOCK_ACQUIRE(&(global_dyn_stats[X].access_lock)); \
-    global_dyn_stats[X].count = (ink_statval_t)0;          \
-    global_dyn_stats[X].sum = (ink_statval_t)0;            \
-    STAT_LOCK_RELEASE(&(global_dyn_stats[X].access_lock)); \
-  }
-#define READ_GLOBAL_DYN_STAT(X, C, S)                      \
-  {                                                        \
-    STAT_LOCK_ACQUIRE(&(global_dyn_stats[X].access_lock)); \
-    C = global_dyn_stats[X].count;                         \
-    S = global_dyn_stats[X].sum;                           \
-    STAT_LOCK_RELEASE(&(global_dyn_stats[X].access_lock)); \
-  }
-#define READ_GLOBAL_HTTP_TRANS_STAT(X, C, S) \
-  {                                          \
-    C = global_http_trans_stats[X].count;    \
-    S = global_http_trans_stats[X].sum;      \
-  }
-#define SET_GLOBAL_DYN_COUNT(X, V)                         \
-  {                                                        \
-    STAT_LOCK_ACQUIRE(&(global_dyn_stats[X].access_lock)); \
-    global_dyn_stats[X].count = V;                         \
-    STAT_LOCK_RELEASE(&(global_dyn_stats[X].access_lock)); \
-  }
-
-#define SET_GLOBAL_DYN_STAT(X, C, S)                       \
-  {                                                        \
-    STAT_LOCK_ACQUIRE(&(global_dyn_stats[X].access_lock)); \
-    global_dyn_stats[X].count = C;                         \
-    global_dyn_stats[X].sum = S;                           \
-    STAT_LOCK_RELEASE(&(global_dyn_stats[X].access_lock)); \
-  }
-
-#define INITIALIZE_GLOBAL_DYN_STATS(X, T) \
-  {                                       \
-    STAT_LOCK_INIT(&(X.access_lock), T);  \
-    X.count = (ink_statval_t)0;           \
-    X.sum = (ink_statval_t)0;             \
-  }
-
-#endif /* USE_LOCKS_FOR_DYN_STATS */
-
-//---------------------------------------------------------------------//
-//                        Function prototypes                          //
-//---------------------------------------------------------------------//
-extern void start_stats_snap(void);
-void initialize_all_global_stats();
-
-//---------------------------------------------------------------------//
-//                 Global variables declaration.                       //
-//---------------------------------------------------------------------//
-extern ink_stat_lock_t global_http_trans_stat_lock;
-extern ink_unprot_global_stat_t global_http_trans_stats[MAX_HTTP_TRANS_STATS];
-#ifndef USE_LOCKS_FOR_DYN_STATS
-extern inkcoreapi ink_unprot_global_stat_t global_dyn_stats[MAX_DYN_STATS - DYN_STAT_START];
-#else
-extern inkcoreapi ink_prot_global_stat_t global_dyn_stats[MAX_DYN_STATS - DYN_STAT_START];
-#endif
-
-#ifdef DEBUG
-extern ink_mutex http_time_lock;
-extern time_t last_http_local_time;
-#endif
-
-#define MAX_HTTP_HANDLER_EVENTS 25
-extern void clear_http_handler_times();
-extern void print_http_handler_time(int event);
-extern void print_all_http_handler_times();
-#ifdef DEBUG
-extern ink_hrtime http_handler_times[MAX_HTTP_HANDLER_EVENTS];
-extern int http_handler_counts[MAX_HTTP_HANDLER_EVENTS];
-#endif
-
-
-#endif /* _StatSystem_h_ */

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/congest/CongestionStats.h
----------------------------------------------------------------------
diff --git a/proxy/congest/CongestionStats.h b/proxy/congest/CongestionStats.h
index ea45d85..0d5a90f 100644
--- a/proxy/congest/CongestionStats.h
+++ b/proxy/congest/CongestionStats.h
@@ -30,8 +30,6 @@
 #ifndef CONGESTION_STATS_H_
 #define CONGESTION_STATS_H_
 
-
-// the stat variables are defined in StatSystem.h, StatSystem.cc
 void register_congest_stats();
 #include "P_RecProcess.h"
 extern RecRawStatBlock *congest_rsb;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/http/HttpCacheSM.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpCacheSM.h b/proxy/http/HttpCacheSM.h
index 9190d2a..e5a9a5f 100644
--- a/proxy/http/HttpCacheSM.h
+++ b/proxy/http/HttpCacheSM.h
@@ -34,7 +34,6 @@
 #define _HTTP_CACHE_SM_H_
 
 #include "P_Cache.h"
-#include "StatSystem.h"
 #include "ProxyConfig.h"
 #include "URL.h"
 #include "HTTP.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/http/HttpConfig.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index 5f99cbd..ee33bbb 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -318,9 +318,9 @@ enum {
 extern RecRawStatBlock *http_rsb;
 
 /* Stats should only be accessed using these macros */
-#define HTTP_INCREMENT_DYN_STAT(x) RecIncrRawStat(http_rsb, mutex->thread_holding, (int)x, 1)
-#define HTTP_DECREMENT_DYN_STAT(x) RecIncrRawStat(http_rsb, mutex->thread_holding, (int)x, -1)
-#define HTTP_SUM_DYN_STAT(x, y) RecIncrRawStat(http_rsb, mutex->thread_holding, (int)x, (int64_t)y)
+#define HTTP_INCREMENT_DYN_STAT(x) RecIncrRawStat(http_rsb, this_ethread(), (int)x, 1)
+#define HTTP_DECREMENT_DYN_STAT(x) RecIncrRawStat(http_rsb, this_ethread(), (int)x, -1)
+#define HTTP_SUM_DYN_STAT(x, y) RecIncrRawStat(http_rsb, this_ethread(), (int)x, (int64_t)y)
 #define HTTP_SUM_GLOBAL_DYN_STAT(x, y) RecIncrGlobalRawStatSum(http_rsb, x, y)
 
 #define HTTP_CLEAR_DYN_STAT(x)          \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index aafa718..6ac4531 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -119,8 +119,6 @@ milestone_update_api_time(TransactionMilestones &milestones, ink_hrtime &api_tim
 
 ClassAllocator<HttpSM> httpSMAllocator("httpSMAllocator");
 
-#define HTTP_INCREMENT_TRANS_STAT(X) HttpTransact::update_stat(&t_state, X, 1);
-
 HttpVCTable::HttpVCTable()
 {
   memset(&vc_table, 0, sizeof(vc_table));
@@ -3280,7 +3278,7 @@ HttpSM::tunnel_handler_cache_read(int event, HttpTunnelProducer *p)
       p->vc->do_io_close(EHTTP_ERROR);
       p->read_vio = NULL;
       tunnel.chain_abort_all(p);
-      HTTP_INCREMENT_TRANS_STAT(http_cache_read_errors);
+      HTTP_INCREMENT_DYN_STAT(http_cache_read_errors);
       break;
     } else {
       tunnel.local_finish_all(p);
@@ -3320,7 +3318,7 @@ HttpSM::tunnel_handler_cache_write(int event, HttpTunnelConsumer *c)
     c->write_vio = NULL;
     c->vc->do_io_close(EHTTP_ERROR);
 
-    HTTP_INCREMENT_TRANS_STAT(http_cache_write_errors);
+    HTTP_INCREMENT_DYN_STAT(http_cache_write_errors);
     DebugSM("http", "[%" PRId64 "] aborting cache write due %s event from cache", sm_id, HttpDebugNames::get_event_name(event));
     // abort the producer if the cache_writevc is the only consumer.
     if (c->producer->alive && c->producer->num_consumers == 1)
@@ -4393,7 +4391,7 @@ HttpSM::do_cache_lookup_and_read()
   // ink_assert(server_session == NULL);
   ink_assert(pending_action == 0);
 
-  HTTP_INCREMENT_TRANS_STAT(http_cache_lookups_stat);
+  HTTP_INCREMENT_DYN_STAT(http_cache_lookups_stat);
 
   milestones[TS_MILESTONE_CACHE_OPEN_READ_BEGIN] = Thread::get_hrtime();
   t_state.cache_lookup_result = HttpTransact::CACHE_LOOKUP_NONE;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/896282b5/proxy/http/HttpSM.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.h b/proxy/http/HttpSM.h
index d5226c1..72e7c2b 100644
--- a/proxy/http/HttpSM.h
+++ b/proxy/http/HttpSM.h
@@ -39,7 +39,6 @@
 #include "HttpTransact.h"
 #include "HttpTunnel.h"
 #include "InkAPIInternal.h"
-#include "StatSystem.h"
 #include "HttpClientSession.h"
 #include "HdrUtils.h"
 //#include "AuthHttpAdapter.h"


Mime
View raw message