This is an automated email from the ASF dual-hosted git repository.

bnolsen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 6e301b6e77 add cache_open_write_fail_count metric (#11795)
6e301b6e77 is described below

commit 6e301b6e77b1e5cdac9cc7702d5f817990d6b495
Author: Brian Olsen <[email protected]>
AuthorDate: Tue Oct 22 06:56:01 2024 -0600

    add cache_open_write_fail_count metric (#11795)
    
    * add cache_open_write_fail_count metric
    
    * remove milestone from cache_open_write_fail metric
    
    ---------
    
    Co-authored-by: Brian Olsen <[email protected]>
---
 include/proxy/http/HttpConfig.h | 1 +
 src/proxy/http/HttpConfig.cc    | 1 +
 src/proxy/http/HttpTransact.cc  | 1 +
 3 files changed, 3 insertions(+)

diff --git a/include/proxy/http/HttpConfig.h b/include/proxy/http/HttpConfig.h
index 1b1f2cac91..a4a0f800d4 100644
--- a/include/proxy/http/HttpConfig.h
+++ b/include/proxy/http/HttpConfig.h
@@ -85,6 +85,7 @@ struct HttpStatsBlock {
   Metrics::Counter::AtomicType *cache_open_write_adjust_thread;
   Metrics::Counter::AtomicType *cache_open_write_begin_time;
   Metrics::Counter::AtomicType *cache_open_write_end_time;
+  Metrics::Counter::AtomicType *cache_open_write_fail_count;
   Metrics::Counter::AtomicType *cache_read_error;
   Metrics::Counter::AtomicType *cache_read_errors;
   Metrics::Counter::AtomicType *cache_updates;
diff --git a/src/proxy/http/HttpConfig.cc b/src/proxy/http/HttpConfig.cc
index 9f126ec943..88e12859bf 100644
--- a/src/proxy/http/HttpConfig.cc
+++ b/src/proxy/http/HttpConfig.cc
@@ -292,6 +292,7 @@ register_stat_callbacks()
   http_rsb.cache_open_write_adjust_thread    = 
Metrics::Counter::createPtr("proxy.process.http.cache.open_write.adjust_thread");
   http_rsb.cache_open_write_begin_time       = 
Metrics::Counter::createPtr("proxy.process.http.milestone.cache_open_write_begin");
   http_rsb.cache_open_write_end_time         = 
Metrics::Counter::createPtr("proxy.process.http.milestone.cache_open_write_end");
+  http_rsb.cache_open_write_fail_count       = 
Metrics::Counter::createPtr("proxy.process.http.cache_open_write_fail_count");
   http_rsb.cache_read_error                  = 
Metrics::Counter::createPtr("proxy.process.http.cache_read_error");
   http_rsb.cache_read_errors                 = 
Metrics::Counter::createPtr("proxy.process.http.cache_read_errors");
   http_rsb.cache_updates                     = 
Metrics::Counter::createPtr("proxy.process.http.cache_updates");
diff --git a/src/proxy/http/HttpTransact.cc b/src/proxy/http/HttpTransact.cc
index 7f17b01a77..33925b33b9 100644
--- a/src/proxy/http/HttpTransact.cc
+++ b/src/proxy/http/HttpTransact.cc
@@ -3140,6 +3140,7 @@ HttpTransact::handle_cache_write_lock(State *s)
   case CACHE_WL_FAIL:
     // No write lock, ignore the cache and proxy only;
     // FIX: Should just serve from cache if this is a revalidate
+    Metrics::Counter::increment(http_rsb.cache_open_write_fail_count);
     s->cache_info.action = CACHE_DO_NO_ACTION;
     switch (s->cache_open_write_fail_action) {
     case CACHE_WL_FAIL_ACTION_ERROR_ON_MISS:

Reply via email to