diff options
| author | liuchang <[email protected]> | 2023-04-03 11:09:45 +0000 |
|---|---|---|
| committer | liuchang <[email protected]> | 2023-04-04 02:33:50 +0000 |
| commit | 72ed9151b6dfa000b413e667e52d59498c7aaad7 (patch) | |
| tree | e0a50bc4b28eaa0de5cb9aef6e6388181cd76098 /shaping/src/shaper_session.cpp | |
| parent | 5e9d5418d1c0950352e3ab704285f8a371a7bae5 (diff) | |
add global metric
Diffstat (limited to 'shaping/src/shaper_session.cpp')
| -rw-r--r-- | shaping/src/shaper_session.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/shaping/src/shaper_session.cpp b/shaping/src/shaper_session.cpp index 6194a90..f45c8d7 100644 --- a/shaping/src/shaper_session.cpp +++ b/shaping/src/shaper_session.cpp @@ -6,6 +6,7 @@ #include "shaper_session.h" #include "shaper_maat.h" #include "shaper_stat.h" +#include "shaper_global_stat.h" #include "shaper.h" struct shaping_flow* shaper_session_opening(struct shaping_thread_ctx *ctx, struct metadata *meta, struct ctrl_pkt_data *ctrl_data, struct raw_pkt_parser *raw_parser) @@ -26,6 +27,8 @@ struct shaping_flow* shaper_session_opening(struct shaping_thread_ctx *ctx, stru session_table_insert(ctx->session_table, meta->session_id, &sf->tuple4, sf, NULL); + shaper_global_stat_curr_session_inc(ctx->global_stat); + return sf; } @@ -43,6 +46,8 @@ struct shaping_flow* shaper_session_close(struct shaping_thread_ctx *ctx, struct sf->flag |= STREAM_CLOSE; session_table_delete_by_id(ctx->session_table, meta->session_id); + shaper_global_stat_curr_session_dec(ctx->global_stat); + return sf; } @@ -84,5 +89,7 @@ void shaper_session_data_free_cb(void *session_data, void *data) shaping_flow_free(sf); } + shaper_global_stat_curr_session_dec(ctx->global_stat); + return; }
\ No newline at end of file |
