SCE增加session new & free的监控指标
This commit is contained in:
@@ -116,6 +116,9 @@ enum SCE_STAT_FIELD
|
||||
STAT_SF_SESSION_NUM,
|
||||
STAT_SF_SESSION_LOG,
|
||||
|
||||
STAT_SESSION_NEW,
|
||||
STAT_SESSION_FREE,
|
||||
|
||||
// max
|
||||
STAT_MAX,
|
||||
};
|
||||
@@ -230,6 +233,9 @@ static const char *stat_map[] =
|
||||
[STAT_SF_SESSION_NUM] = "curr_sessions",
|
||||
[STAT_SF_SESSION_LOG] = "session_logs",
|
||||
|
||||
[STAT_SESSION_NEW] = "session_new",
|
||||
[STAT_SESSION_FREE] = "session_free",
|
||||
|
||||
[STAT_MAX] = NULL};
|
||||
|
||||
static void global_metrics_parse_config(const char *profile, struct metrics_config *config)
|
||||
@@ -426,6 +432,8 @@ void global_metrics_dump(struct global_metrics *global_metrics)
|
||||
sum->sf_inactive += thread->sf_inactive;
|
||||
sum->session_num += thread->session_num;
|
||||
sum->session_log += thread->session_log;
|
||||
sum->session_new += thread->session_new;
|
||||
sum->session_free += thread->session_free;
|
||||
|
||||
memset(thread, 0, sizeof(struct thread_metrics));
|
||||
ATOMIC_SET(&(global_metrics->thread_metrics_flag[i]), THREAD_METRICS_CACHE_IS_FREE);
|
||||
@@ -537,5 +545,8 @@ void global_metrics_dump(struct global_metrics *global_metrics)
|
||||
FS_operate(global_metrics->fs_handle, global_metrics->fs_id[STAT_SF_SESSION_NUM], 0, FS_OP_SET, sum->session_num);
|
||||
FS_operate(global_metrics->fs_handle, global_metrics->fs_id[STAT_SF_SESSION_LOG], 0, FS_OP_SET, sum->session_log);
|
||||
|
||||
FS_operate(global_metrics->fs_handle, global_metrics->fs_id[STAT_SESSION_NEW], 0, FS_OP_SET, sum->session_new);
|
||||
FS_operate(global_metrics->fs_handle, global_metrics->fs_id[STAT_SESSION_FREE], 0, FS_OP_SET, sum->session_free);
|
||||
|
||||
FS_passive_output(global_metrics->fs_handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user