summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2024-08-30 11:47:22 +0800
committerfengweihao <[email protected]>2024-08-30 11:47:22 +0800
commit268b80c3de6727ba0d82af3df433091b2225142e (patch)
tree1227eb0fc3747a229d93698ac6345dfdc66339fb /plugin
parentd6fd0f973d38eeeec38ecdd578f0c1392a614e22 (diff)
TSG-22251 Manipulate统计中,当Metric无有效数值时,不在调用filedstat4发送Metricv4.10.1-20240830
Diffstat (limited to 'plugin')
-rw-r--r--plugin/business/tsg-http/src/tsg_http.cpp5
1 files changed, 5 insertions, 0 deletions
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);