trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [12/21] git commit: TS-2165: Introduce cluster-wide logging stats
Date Wed, 04 Sep 2013 02:27:16 GMT
TS-2165: Introduce cluster-wide logging stats

With this patch, we can see the logging status of whole cluster.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>


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

Branch: refs/heads/5.0.x
Commit: 49e8a7a0e538a53083b564baaf06a51f96acc831
Parents: a415123
Author: Yunkai Zhang <qiushu.zyk@taobao.com>
Authored: Thu Aug 29 01:27:33 2013 +0800
Committer: Yunkai Zhang <qiushu.zyk@taobao.com>
Committed: Mon Sep 2 16:35:13 2013 +0800

----------------------------------------------------------------------
 CHANGES                               |   2 +
 mgmt/RecordsConfig.cc                 | 110 ++++++++++++++++++++
 proxy/config/stats.config.xml.default | 156 +++++++++++++++++++++++++++++
 proxy/logging/Log.cc                  |  16 ++-
 proxy/logging/LogConfig.cc            |  24 ++++-
 proxy/logging/LogConfig.h             |   6 ++
 proxy/logging/LogFile.cc              |  11 +-
 proxy/logging/LogHost.cc              |   8 ++
 proxy/logging/LogObject.cc            |   3 +
 9 files changed, 329 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49e8a7a0/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 24b2323..5a80c2f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.1.0
 
+  *) [TS-2165] Introduce cluster-wide logging stats
+
   *) [TS-2167] Update apichecker.pl to give suggestions on additional
    deprecated APIs
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49e8a7a0/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 93e8c7d..da8e36e 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1671,6 +1671,61 @@ RecordElement RecordsConfig[] = {
   {RECT_NODE, "proxy.node.user_agents_total_documents_served", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
 
+  //
+  //#
+  //# Logging stats on NODE
+  //#
+  {RECT_NODE, "proxy.node.log.event_log_error_ok", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL,
NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.event_log_error_skip", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL,
NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.event_log_error_aggr", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL,
NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.event_log_error_full", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL,
NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.event_log_error_fail", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL,
NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.event_log_access_ok", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL,
NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.event_log_access_skip", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.event_log_access_aggr", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.event_log_access_full", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.event_log_access_fail", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.num_sent_to_network", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL,
NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.num_lost_before_sent_to_network", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.num_received_from_network", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.num_flush_to_disk", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL,
NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.num_lost_before_flush_to_disk", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_lost_before_preproc", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_sent_to_network", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_lost_before_sent_to_network", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_sent_to_network_avg_10s", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_received_from_network", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_received_from_network_avg_10s", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_flush_to_disk", RECD_INT, "0", RECU_NULL, RR_NULL, RECC_NULL,
NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_lost_before_flush_to_disk", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_written_to_disk", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_NODE, "proxy.node.log.bytes_lost_before_written_to_disk", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+
   //#
   //# Add CLUSTER    Records Here
   //#
@@ -1781,6 +1836,61 @@ RecordElement RecordsConfig[] = {
   {RECT_CLUSTER, "proxy.cluster.current_server_connections", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
   ,
 
+  //
+  //#
+  //# Logging stats on CLUSTER
+  //#
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_error_ok", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_error_skip", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_error_aggr", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_error_full", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_error_fail", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_access_ok", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_access_skip", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_access_aggr", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_access_full", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.event_log_access_fail", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.num_sent_to_network", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.num_lost_before_sent_to_network", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.num_received_from_network", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.num_flush_to_disk", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.num_lost_before_flush_to_disk", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_lost_before_preproc", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_sent_to_network", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_lost_before_sent_to_network", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_sent_to_network_avg_10s", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_received_from_network", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_received_from_network_avg_10s", RECD_INT, "0",
RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_flush_to_disk", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_lost_before_flush_to_disk", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_written_to_disk", RECD_INT, "0", RECU_NULL, RR_NULL,
RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CLUSTER, "proxy.cluster.log.bytes_lost_before_written_to_disk", RECD_INT, "0", RECU_NULL,
RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+
   //#
   //# SSL parent proxying info
   //#

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49e8a7a0/proxy/config/stats.config.xml.default
----------------------------------------------------------------------
diff --git a/proxy/config/stats.config.xml.default b/proxy/config/stats.config.xml.default
index ac6d211..6d97a7a 100644
--- a/proxy/config/stats.config.xml.default
+++ b/proxy/config/stats.config.xml.default
@@ -1790,6 +1790,162 @@
         </expression>
     </statistics>
 
+    <!-- Logging -->
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.event_log_access_ok</destination>
+	<destination scope="cluster">proxy.cluster.log.event_log_access_ok</destination>
+        <expression>
+	    proxy.process.log.event_log_access_ok
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.event_log_access_skip</destination>
+	<destination scope="cluster">proxy.cluster.log.event_log_access_skip</destination>
+        <expression>
+	    proxy.process.log.event_log_access_skip
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.event_log_access_aggr</destination>
+	<destination scope="cluster">proxy.cluster.log.event_log_access_aggr</destination>
+        <expression>
+	    proxy.process.log.event_log_access_aggr
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.event_log_access_full</destination>
+	<destination scope="cluster">proxy.cluster.log.event_log_access_full</destination>
+        <expression>
+            proxy.process.log.event_log_access_full
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.event_log_access_fail</destination>
+	<destination scope="cluster">proxy.cluster.log.event_log_access_fail</destination>
+        <expression>
+            proxy.process.log.event_log_access_fail
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.num_lost_before_sent_to_network</destination>
+	<destination scope="cluster">proxy.cluster.log.num_lost_before_sent_to_network</destination>
+        <expression>
+            proxy.process.log.num_lost_before_sent_to_network
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.num_sent_to_network</destination>
+	<destination scope="cluster">proxy.cluster.log.num_sent_to_network</destination>
+        <expression>
+            proxy.process.log.num_sent_to_network
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.bytes_lost_before_sent_to_network</destination>
+	<destination scope="cluster">proxy.cluster.log.bytes_lost_before_sent_to_network</destination>
+        <expression>
+            proxy.process.log.bytes_lost_before_sent_to_network
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.bytes_sent_to_network</destination>
+	<destination scope="cluster">proxy.cluster.log.bytes_sent_to_network</destination>
+        <expression>
+            proxy.process.log.bytes_sent_to_network
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.num_received_from_network</destination>
+	<destination scope="cluster">proxy.cluster.log.num_received_from_network</destination>
+        <expression>
+            proxy.process.log.num_received_from_network
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.bytes_received_from_network</destination>
+	<destination scope="cluster">proxy.cluster.log.bytes_received_from_network</destination>
+        <expression>
+            proxy.process.log.bytes_received_from_network
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.bytes_lost_before_preproc</destination>
+	<destination scope="cluster">proxy.cluster.log.bytes_lost_before_preproc</destination>
+        <expression>
+            proxy.process.log.bytes_lost_before_preproc
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.num_lost_before_flush_to_disk</destination>
+	<destination scope="cluster">proxy.cluster.log.num_lost_before_flush_to_disk</destination>
+        <expression>
+            proxy.process.log.num_lost_before_flush_to_disk
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.bytes_lost_before_flush_to_disk</destination>
+	<destination scope="cluster">proxy.cluster.log.bytes_lost_before_flush_to_disk</destination>
+        <expression>
+            proxy.process.log.bytes_lost_before_flush_to_disk
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0">
+        <destination>proxy.node.log.bytes_lost_before_written_to_disk</destination>
+	<destination scope="cluster">proxy.cluster.log.bytes_lost_before_written_to_disk</destination>
+        <expression>
+            proxy.process.log.bytes_lost_before_written_to_disk
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0"
+        interval="10">
+        <destination>proxy.node.log.bytes_sent_to_network_avg_10s</destination>
+        <destination scope="cluster">proxy.cluster.log.bytes_sent_to_network_avg_10s</destination>
+        <expression>
+            #proxy.process.log.bytes_sent_to_network
+        </expression>
+    </statistics>
+
+    <statistics
+	minimum="0"
+        interval="10">
+        <destination>proxy.node.log.bytes_received_from_network_avg_10s</destination>
+        <destination scope="cluster">proxy.cluster.log.bytes_received_from_network_avg_10s</destination>
+        <expression>
+            #proxy.process.log.bytes_received_from_network
+        </expression>
+    </statistics>
+
 </ink:statistics>
 
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49e8a7a0/proxy/logging/Log.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index ec3c7ca..ea6493f 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -1370,6 +1370,10 @@ Log::flush_thread_main(void * /* args ATS_UNUSED */)
       if (!logfile->is_open()) {
         Warning("File:%s was closed, have dropped (%d) bytes.",
                 logfile->m_name, total_bytes);
+
+        RecIncrRawStat(log_rsb, mutex->thread_holding,
+                       log_stat_bytes_lost_before_written_to_disk_stat,
+                       total_bytes);
         delete fdata;
         continue;
       }
@@ -1380,6 +1384,10 @@ Log::flush_thread_main(void * /* args ATS_UNUSED */)
         if (Log::config->logging_space_exhausted) {
           Warning("logging space exhausted, failed to write file:%s, have dropped (%d) bytes.",
                   logfile->m_name, (total_bytes - bytes_written));
+
+          RecIncrRawStat(log_rsb, mutex->thread_holding,
+                         log_stat_bytes_lost_before_written_to_disk_stat,
+                         total_bytes - bytes_written);
           break;
         }
 
@@ -1387,8 +1395,12 @@ Log::flush_thread_main(void * /* args ATS_UNUSED */)
                       total_bytes - bytes_written);
         if (len < 0) {
           Error("Failed to write log to %s: [tried %d, wrote %d, %s]",
-                logfile->m_name, total_bytes, bytes_written, strerror(errno));
-          ink_release_assert(!"test");
+                logfile->m_name, total_bytes - bytes_written,
+                bytes_written, strerror(errno));
+
+          RecIncrRawStat(log_rsb, mutex->thread_holding,
+                         log_stat_bytes_lost_before_written_to_disk_stat,
+                         total_bytes - bytes_written);
           break;
         }
         bytes_written += len;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49e8a7a0/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index 7dbabed..d04fd48 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -1349,25 +1349,43 @@ LogConfig::register_stat_callbacks()
   //
   RecRegisterRawStat(log_rsb, RECT_PROCESS,
                      "proxy.process.log.num_sent_to_network",
-                     RECD_INT, RECP_PERSISTENT, (int) log_stat_num_sent_to_network_stat,
RecRawStatSyncSum);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) log_stat_num_sent_to_network_stat,
RecRawStatSyncSum);
+  RecRegisterRawStat(log_rsb, RECT_PROCESS,
+                     "proxy.process.log.num_lost_before_sent_to_network",
+                     RECD_COUNTER, RECP_PERSISTENT, (int) log_stat_num_lost_before_sent_to_network_stat,
RecRawStatSyncSum);
   RecRegisterRawStat(log_rsb, RECT_PROCESS,
                      "proxy.process.log.num_received_from_network",
-                     RECD_INT, RECP_PERSISTENT, (int) log_stat_num_received_from_network_stat,
RecRawStatSyncSum);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) log_stat_num_received_from_network_stat,
RecRawStatSyncSum);
   RecRegisterRawStat(log_rsb, RECT_PROCESS,
                      "proxy.process.log.num_flush_to_disk",
-                     RECD_INT, RECP_PERSISTENT, (int) log_stat_num_flush_to_disk_stat, RecRawStatSyncSum);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) log_stat_num_flush_to_disk_stat,
RecRawStatSyncSum);
+  RecRegisterRawStat(log_rsb, RECT_PROCESS,
+                     "proxy.process.log.num_lost_before_flush_to_disk",
+                     RECD_COUNTER, RECP_PERSISTENT, (int) log_stat_num_lost_before_flush_to_disk_stat,
RecRawStatSyncSum);
+  RecRegisterRawStat(log_rsb, RECT_PROCESS,
+                     "proxy.process.log.bytes_lost_before_preproc",
+                     RECD_INT, RECP_PERSISTENT, (int) log_stat_bytes_lost_before_preproc_stat,
RecRawStatSyncSum);
   RecRegisterRawStat(log_rsb, RECT_PROCESS,
                      "proxy.process.log.bytes_sent_to_network",
                      RECD_INT, RECP_PERSISTENT, (int) log_stat_bytes_sent_to_network_stat,
RecRawStatSyncSum);
   RecRegisterRawStat(log_rsb, RECT_PROCESS,
+                     "proxy.process.log.bytes_lost_before_sent_to_network",
+                     RECD_INT, RECP_PERSISTENT, (int) log_stat_bytes_lost_before_sent_to_network_stat,
RecRawStatSyncSum);
+  RecRegisterRawStat(log_rsb, RECT_PROCESS,
                      "proxy.process.log.bytes_received_from_network",
                      RECD_INT, RECP_PERSISTENT, (int) log_stat_bytes_received_from_network_stat,
RecRawStatSyncSum);
   RecRegisterRawStat(log_rsb, RECT_PROCESS,
                      "proxy.process.log.bytes_flush_to_disk",
                      RECD_INT, RECP_PERSISTENT, (int) log_stat_bytes_flush_to_disk_stat,
RecRawStatSyncSum);
   RecRegisterRawStat(log_rsb, RECT_PROCESS,
+                     "proxy.process.log.bytes_lost_before_flush_to_disk",
+                     RECD_INT, RECP_PERSISTENT, (int) log_stat_bytes_lost_before_flush_to_disk_stat,
RecRawStatSyncSum);
+  RecRegisterRawStat(log_rsb, RECT_PROCESS,
                      "proxy.process.log.bytes_written_to_disk",
                      RECD_INT, RECP_PERSISTENT, (int) log_stat_bytes_written_to_disk_stat,
RecRawStatSyncSum);
+  RecRegisterRawStat(log_rsb, RECT_PROCESS,
+                     "proxy.process.log.bytes_lost_before_written_to_disk",
+                     RECD_INT, RECP_PERSISTENT, (int) log_stat_bytes_lost_before_written_to_disk_stat,
RecRawStatSyncSum);
   //
   // I/O
   //

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49e8a7a0/proxy/logging/LogConfig.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.h b/proxy/logging/LogConfig.h
index d9e46c4..f715e8c 100644
--- a/proxy/logging/LogConfig.h
+++ b/proxy/logging/LogConfig.h
@@ -50,14 +50,20 @@ enum
 
   // Logging Data
   log_stat_num_sent_to_network_stat,
+  log_stat_num_lost_before_sent_to_network_stat,
   log_stat_num_received_from_network_stat,
   log_stat_num_flush_to_disk_stat,
+  log_stat_num_lost_before_flush_to_disk_stat,
 
+  log_stat_bytes_lost_before_preproc_stat,
   log_stat_bytes_sent_to_network_stat,
+  log_stat_bytes_lost_before_sent_to_network_stat,
   log_stat_bytes_received_from_network_stat,
 
   log_stat_bytes_flush_to_disk_stat,
+  log_stat_bytes_lost_before_flush_to_disk_stat,
   log_stat_bytes_written_to_disk_stat,
+  log_stat_bytes_lost_before_written_to_disk_stat,
 
   // Logging I/O
   log_stat_log_files_open_stat,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49e8a7a0/proxy/logging/LogFile.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogFile.cc b/proxy/logging/LogFile.cc
index c27dc20..68aa90c 100644
--- a/proxy/logging/LogFile.cc
+++ b/proxy/logging/LogFile.cc
@@ -628,6 +628,7 @@ LogFile::write_ascii_logbuffer3(LogBufferHeader * buffer_header, char
*alt_forma
   Debug("log-file", "entering LogFile::write_ascii_logbuffer3 for %s " "(this=%p)", m_name,
this);
   ink_assert(buffer_header != NULL);
 
+  ProxyMutex *mutex = this_thread()->mutex;
   LogBufferIterator iter(buffer_header);
   LogEntryHeader *entry_header;
   int fmt_entry_count = 0;
@@ -684,6 +685,14 @@ LogFile::write_ascii_logbuffer3(LogBufferHeader * buffer_header, char
*alt_forma
       } else {
         Error("Failed to convert LogBuffer to ascii, have dropped (%" PRIu32 ") bytes.",
               entry_header->entry_len);
+
+        RecIncrRawStat(log_rsb, mutex->thread_holding,
+                       log_stat_num_lost_before_flush_to_disk_stat,
+                       fmt_entry_count);
+
+        RecIncrRawStat(log_rsb, mutex->thread_holding,
+                       log_stat_bytes_lost_before_flush_to_disk_stat,
+                       fmt_buf_bytes);
       }
       // if writing to a pipe, fill the buffer with a single
       // record to avoid as much as possible overflowing the
@@ -700,8 +709,6 @@ LogFile::write_ascii_logbuffer3(LogBufferHeader * buffer_header, char
*alt_forma
     //
     LogFlushData *flush_data = new LogFlushData(this, ascii_buffer, fmt_buf_bytes);
 
-    ProxyMutex *mutex = this_thread()->mutex;
-
     RecIncrRawStat(log_rsb, mutex->thread_holding, log_stat_num_flush_to_disk_stat,
                    fmt_entry_count);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49e8a7a0/proxy/logging/LogHost.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogHost.cc b/proxy/logging/LogHost.cc
index 54297f5..84e08f4 100644
--- a/proxy/logging/LogHost.cc
+++ b/proxy/logging/LogHost.cc
@@ -343,6 +343,14 @@ done:
 void
 LogHost::orphan_write_and_try_delete(LogBuffer * lb)
 {
+  RecIncrRawStat(log_rsb, this_thread()->mutex->thread_holding,
+                 log_stat_num_lost_before_sent_to_network_stat,
+                 lb->header()->entry_count);
+
+  RecIncrRawStat(log_rsb, this_thread()->mutex->thread_holding,
+                 log_stat_bytes_lost_before_sent_to_network_stat,
+                 lb->header()->byte_count);
+
   if (!Log::config->logging_space_exhausted) {
     Debug("log-host", "Sending LogBuffer to orphan file %s", m_orphan_file->get_name());
     m_orphan_file->preproc_and_try_delete(lb);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/49e8a7a0/proxy/logging/LogObject.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogObject.cc b/proxy/logging/LogObject.cc
index 7bcbf9f..089c8eb 100644
--- a/proxy/logging/LogObject.cc
+++ b/proxy/logging/LogObject.cc
@@ -51,6 +51,9 @@ LogBufferManager::preproc_buffers(LogBufferSink *sink) {
       delete b;
       ink_atomic_increment(&_num_flush_buffers, -1);
       Warning("Dropping log buffer, can't keep up.");
+      RecIncrRawStat(log_rsb, this_thread()->mutex->thread_holding,
+                     log_stat_bytes_lost_before_preproc_stat,
+                     b->header()->byte_count);
     } else {
       new_q.push(b);
     }


Mime
View raw message