From b42c5f09e86ef21fba67ce5c3d30e1dd1f4a1f63 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Thu, 10 Aug 2023 15:08:43 -0400 Subject: [PATCH] W-13897522: Fix dropped message metric value --- .../com/demandware/carbonj/service/engine/MetricList.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/MetricList.java b/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/MetricList.java index 19a36760..b45eed08 100644 --- a/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/MetricList.java +++ b/carbonj.service/src/main/java/com/demandware/carbonj/service/engine/MetricList.java @@ -64,12 +64,16 @@ public boolean match(String name) } StringsCache.State state = StringsCache.getState(name); + boolean isBlackListed = false; if (state != null && state.getBlackListed() != null) { - return state.getBlackListed(); + isBlackListed = state.getBlackListed(); + if (isBlackListed) { + droppedMetrics.inc(); + } + return isBlackListed; } List currentPatterns = patterns; // copy so we don't keep hitting the volatile barrier - boolean isBlackListed = false; for ( Pattern p : currentPatterns ) { if( ".*".equals( p.pattern() ) )