diff options
| author | wangmenglan <[email protected]> | 2024-01-19 10:52:42 +0800 |
|---|---|---|
| committer | wangmenglan <[email protected]> | 2024-01-25 18:45:57 +0800 |
| commit | 86e2eb3b999f0ee60f7542736bd909c1fac18dfa (patch) | |
| tree | 68a106d76a5386a369ff3029cb9f05daad16d793 /common/src/tfe_packet_io.cpp | |
| parent | 45aff69d9158c7dd26ae7fdfcd3960e9e55515da (diff) | |
PacketIO实时发送metrics统计v4.8.63-20230125
Diffstat (limited to 'common/src/tfe_packet_io.cpp')
| -rw-r--r-- | common/src/tfe_packet_io.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/src/tfe_packet_io.cpp b/common/src/tfe_packet_io.cpp index ce2cf0b..7ecb2e9 100644 --- a/common/src/tfe_packet_io.cpp +++ b/common/src/tfe_packet_io.cpp @@ -1304,7 +1304,7 @@ static int handle_session_closing(struct metadata *meta, struct ctrl_pkt_parser { struct session_ctx *s_ctx = (struct session_ctx *)node->val_data; TFE_LOG_INFO(logger, "%s: session %lu closing", LOG_TAG_PKTIO, s_ctx->session_id); - tfe_set_intercept_metric(acceptor_ctx->metric, s_ctx->cmsg, 1, s_ctx->c2s_info.rx.n_pkts, s_ctx->c2s_info.rx.n_bytes, s_ctx->c2s_info.is_e2i_dir, s_ctx->s2c_info.rx.n_pkts, s_ctx->s2c_info.rx.n_bytes, s_ctx->s2c_info.is_e2i_dir, thread_seq); + tfe_set_intercept_metric(acceptor_ctx->metric, s_ctx, thread_seq, 1); session_table_delete_by_id(thread->session_table, meta->session_id); ATOMIC_DEC(&(packet_io_fs->session_num)); return 0; @@ -1391,6 +1391,7 @@ static int handle_control_packet(struct packet_io *handle, marsio_buff_t *rx_buf static int handle_raw_packet_from_nf(struct packet_io *handle, marsio_buff_t *rx_buff, int thread_seq, void *ctx) { struct packet_io_thread_ctx *thread = (struct packet_io_thread_ctx *)ctx; + struct acceptor_kni_v4 *acceptor_ctx = thread->ref_acceptor_ctx; struct packet_io *packet_io = thread->ref_io; struct packet_io_fs *packet_io_fs = thread->ret_fs_state; struct packet pkt; @@ -1465,6 +1466,7 @@ static int handle_raw_packet_from_nf(struct packet_io *handle, marsio_buff_t *rx throughput_metrics_inc(&s_ctx->s2c_info.rx, 1, raw_len); } + tfe_set_intercept_metric(acceptor_ctx->metric, s_ctx, thread_seq, 0); flag = tfe_cmsg_get_flag(s_ctx->cmsg); if (flag & TFE_CMSG_FLAG_USER0) { send_event_log(s_ctx, thread_seq, ctx); @@ -1517,6 +1519,7 @@ static int handle_raw_packet_from_nf(struct packet_io *handle, marsio_buff_t *rx is_ipv4 = s_ctx->s2c_info.is_ipv4; throughput_metrics_inc(&s_ctx->s2c_info.rx, 1, raw_len); } + tfe_set_intercept_metric(acceptor_ctx->metric, s_ctx, thread_seq, 0); if (header != NULL) { char *packet_buff = NULL; |
