From 268b80c3de6727ba0d82af3df433091b2225142e Mon Sep 17 00:00:00 2001 From: fengweihao Date: Fri, 30 Aug 2024 11:47:22 +0800 Subject: TSG-22251 Manipulate统计中,当Metric无有效数值时,不在调用filedstat4发送Metric MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/tsg-http/src/tsg_http.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugin') diff --git a/plugin/business/tsg-http/src/tsg_http.cpp b/plugin/business/tsg-http/src/tsg_http.cpp index 2f4e263..511d53e 100644 --- a/plugin/business/tsg-http/src/tsg_http.cpp +++ b/plugin/business/tsg-http/src/tsg_http.cpp @@ -1469,6 +1469,11 @@ void proxy_send_metric_log(const struct tfe_stream * stream, struct proxy_http_c out_bytes=0; } + if(hit_cnt == 0 && in_bytes == 0 && out_bytes == 0) + { + continue; + } + tfe_fieldstat_manipulation_incrby(fieldstat, fieldstat->counter_array[COLUMN_HIT_COUNT], hit_cnt, fieldstat->tags[thread_id], TAG_MAX - 1, thread_id); tfe_fieldstat_manipulation_incrby(fieldstat, fieldstat->counter_array[COLUMN_IN_BYTES], in_bytes, fieldstat->tags[thread_id], TAG_MAX - 1, thread_id); tfe_fieldstat_manipulation_incrby(fieldstat, fieldstat->counter_array[COLUMN_OUT_BYTES], out_bytes, fieldstat->tags[thread_id], TAG_MAX - 1, thread_id); -- cgit v1.2.3