perf: Optimize the output of global metrics to reduce atomic operations

This commit is contained in:
luwenpeng
2023-10-12 16:31:53 +08:00
parent 4f870de963
commit 8d1a9b3be5
10 changed files with 265 additions and 160 deletions

View File

@@ -26,11 +26,11 @@ TEST(POLICY, SELECTED_CHAINING_LIFE_CYCLE)
TEST(POLICY, POLICY_ENFORCER_LIFE_CYCLE)
{
struct global_metrics g_metrics;
struct global_metrics global_metrics;
struct thread_ctx t_ctx;
struct session_ctx s_ctx;
t_ctx.ref_metrics = &g_metrics;
t_ctx.ref_global_metrics = &global_metrics;
s_ctx.ref_thread_ctx = &t_ctx;
s_ctx.session_id = 1;
s_ctx.session_addr = (char *)"1.1.1.1 11 2.2.2.2 22";