Update stat of session manager

This commit is contained in:
luwenpeng
2024-04-30 17:03:36 +08:00
parent 388144b8c0
commit c59f178769
12 changed files with 388 additions and 376 deletions

View File

@@ -70,20 +70,22 @@ struct stat_id
int ip6_flow_bypass_dup_last_frag;
// TCP session
int nr_tcp_sess_used;
int nr_tcp_sess_opening;
int nr_tcp_sess_active;
int nr_tcp_sess_closing;
int nr_tcp_sess_discard;
int nr_tcp_sess_closed;
int total_nr_tcp_sess_used;
int curr_nr_tcp_sess_used;
int curr_nr_tcp_sess_opening;
int curr_nr_tcp_sess_active;
int curr_nr_tcp_sess_closing;
int curr_nr_tcp_sess_discard;
int curr_nr_tcp_sess_closed;
// UDP session
int nr_udp_sess_used;
int nr_udp_sess_opening;
int nr_udp_sess_active;
int nr_udp_sess_closing;
int nr_udp_sess_discard;
int nr_udp_sess_closed;
int total_nr_udp_sess_used;
int curr_nr_udp_sess_used;
int curr_nr_udp_sess_opening;
int curr_nr_udp_sess_active;
int curr_nr_udp_sess_closing;
int curr_nr_udp_sess_discard;
int curr_nr_udp_sess_closed;
// Evicted session
int nr_tcp_sess_evicted;
@@ -196,19 +198,21 @@ struct stellar_stat *stellar_stat_new(uint16_t nr_thread)
stat->ids.ip6_flow_bypass_dup_fist_frag = fieldstat_easy_register_counter(stat->fs, "ip6_flow_bypass_dup_fist_frag");
stat->ids.ip6_flow_bypass_dup_last_frag = fieldstat_easy_register_counter(stat->fs, "ip6_flow_bypass_dup_last_frag");
// TCP session
stat->ids.nr_tcp_sess_used = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_used");
stat->ids.nr_tcp_sess_opening = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_opening");
stat->ids.nr_tcp_sess_active = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_active");
stat->ids.nr_tcp_sess_closing = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_closing");
stat->ids.nr_tcp_sess_discard = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_discard");
stat->ids.nr_tcp_sess_closed = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_closed");
stat->ids.total_nr_tcp_sess_used = fieldstat_easy_register_counter(stat->fs, "total_nr_tcp_sess_used");
stat->ids.curr_nr_tcp_sess_used = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_used");
stat->ids.curr_nr_tcp_sess_opening = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_opening");
stat->ids.curr_nr_tcp_sess_active = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_active");
stat->ids.curr_nr_tcp_sess_closing = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_closing");
stat->ids.curr_nr_tcp_sess_discard = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_discard");
stat->ids.curr_nr_tcp_sess_closed = fieldstat_easy_register_counter(stat->fs, "curr_tcp_sess_closed");
// UDP session
stat->ids.nr_udp_sess_used = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_used");
stat->ids.nr_udp_sess_opening = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_opening");
stat->ids.nr_udp_sess_active = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_active");
stat->ids.nr_udp_sess_closing = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_closing");
stat->ids.nr_udp_sess_discard = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_discard");
stat->ids.nr_udp_sess_closed = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_closed");
stat->ids.total_nr_udp_sess_used = fieldstat_easy_register_counter(stat->fs, "total_nr_udp_sess_used");
stat->ids.curr_nr_udp_sess_used = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_used");
stat->ids.curr_nr_udp_sess_opening = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_opening");
stat->ids.curr_nr_udp_sess_active = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_active");
stat->ids.curr_nr_udp_sess_closing = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_closing");
stat->ids.curr_nr_udp_sess_discard = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_discard");
stat->ids.curr_nr_udp_sess_closed = fieldstat_easy_register_counter(stat->fs, "curr_udp_sess_closed");
// Evicted session
stat->ids.nr_tcp_sess_evicted = fieldstat_easy_register_counter(stat->fs, "tcp_sess_evicted");
stat->ids.nr_udp_sess_evicted = fieldstat_easy_register_counter(stat->fs, "udp_sess_evicted");
@@ -313,19 +317,21 @@ void stellar_stat_output(struct stellar_stat *stat)
memset(&stat->thr_ip_stat[i], 0, sizeof(struct ip_reassembly_stat));
// session manager stat
stat->sess_stat.nr_tcp_sess_used += stat->thr_sess_stat[i].nr_tcp_sess_used;
stat->sess_stat.nr_tcp_sess_opening += stat->thr_sess_stat[i].nr_tcp_sess_opening;
stat->sess_stat.nr_tcp_sess_active += stat->thr_sess_stat[i].nr_tcp_sess_active;
stat->sess_stat.nr_tcp_sess_closing += stat->thr_sess_stat[i].nr_tcp_sess_closing;
stat->sess_stat.nr_tcp_sess_discard += stat->thr_sess_stat[i].nr_tcp_sess_discard;
stat->sess_stat.nr_tcp_sess_closed += stat->thr_sess_stat[i].nr_tcp_sess_closed;
stat->sess_stat.total_nr_tcp_sess_used += stat->thr_sess_stat[i].total_nr_tcp_sess_used;
stat->sess_stat.curr_nr_tcp_sess_used += stat->thr_sess_stat[i].curr_nr_tcp_sess_used;
stat->sess_stat.curr_nr_tcp_sess_opening += stat->thr_sess_stat[i].curr_nr_tcp_sess_opening;
stat->sess_stat.curr_nr_tcp_sess_active += stat->thr_sess_stat[i].curr_nr_tcp_sess_active;
stat->sess_stat.curr_nr_tcp_sess_closing += stat->thr_sess_stat[i].curr_nr_tcp_sess_closing;
stat->sess_stat.curr_nr_tcp_sess_discard += stat->thr_sess_stat[i].curr_nr_tcp_sess_discard;
stat->sess_stat.curr_nr_tcp_sess_closed += stat->thr_sess_stat[i].curr_nr_tcp_sess_closed;
stat->sess_stat.nr_udp_sess_used += stat->thr_sess_stat[i].nr_udp_sess_used;
stat->sess_stat.nr_udp_sess_opening += stat->thr_sess_stat[i].nr_udp_sess_opening;
stat->sess_stat.nr_udp_sess_active += stat->thr_sess_stat[i].nr_udp_sess_active;
stat->sess_stat.nr_udp_sess_closing += stat->thr_sess_stat[i].nr_udp_sess_closing;
stat->sess_stat.nr_udp_sess_discard += stat->thr_sess_stat[i].nr_udp_sess_discard;
stat->sess_stat.nr_udp_sess_closed += stat->thr_sess_stat[i].nr_udp_sess_closed;
stat->sess_stat.total_nr_udp_sess_used += stat->thr_sess_stat[i].total_nr_udp_sess_used;
stat->sess_stat.curr_nr_udp_sess_used += stat->thr_sess_stat[i].curr_nr_udp_sess_used;
stat->sess_stat.curr_nr_udp_sess_opening += stat->thr_sess_stat[i].curr_nr_udp_sess_opening;
stat->sess_stat.curr_nr_udp_sess_active += stat->thr_sess_stat[i].curr_nr_udp_sess_active;
stat->sess_stat.curr_nr_udp_sess_closing += stat->thr_sess_stat[i].curr_nr_udp_sess_closing;
stat->sess_stat.curr_nr_udp_sess_discard += stat->thr_sess_stat[i].curr_nr_udp_sess_discard;
stat->sess_stat.curr_nr_udp_sess_closed += stat->thr_sess_stat[i].curr_nr_udp_sess_closed;
stat->sess_stat.nr_tcp_sess_evicted += stat->thr_sess_stat[i].nr_tcp_sess_evicted;
stat->sess_stat.nr_udp_sess_evicted += stat->thr_sess_stat[i].nr_udp_sess_evicted;
@@ -398,19 +404,21 @@ void stellar_stat_output(struct stellar_stat *stat)
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.ip6_flow_bypass_dup_fist_frag, NULL, 0, stat->ip_stat.ip6_flow_bypass_dup_fist_frag);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.ip6_flow_bypass_dup_last_frag, NULL, 0, stat->ip_stat.ip6_flow_bypass_dup_last_frag);
// TCP session
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_tcp_sess_used, NULL, 0, stat->sess_stat.nr_tcp_sess_used);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_tcp_sess_opening, NULL, 0, stat->sess_stat.nr_tcp_sess_opening);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_tcp_sess_active, NULL, 0, stat->sess_stat.nr_tcp_sess_active);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_tcp_sess_closing, NULL, 0, stat->sess_stat.nr_tcp_sess_closing);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_tcp_sess_discard, NULL, 0, stat->sess_stat.nr_tcp_sess_discard);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_tcp_sess_closed, NULL, 0, stat->sess_stat.nr_tcp_sess_closed);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.total_nr_tcp_sess_used, NULL, 0, stat->sess_stat.total_nr_tcp_sess_used);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_tcp_sess_used, NULL, 0, stat->sess_stat.curr_nr_tcp_sess_used);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_tcp_sess_opening, NULL, 0, stat->sess_stat.curr_nr_tcp_sess_opening);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_tcp_sess_active, NULL, 0, stat->sess_stat.curr_nr_tcp_sess_active);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_tcp_sess_closing, NULL, 0, stat->sess_stat.curr_nr_tcp_sess_closing);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_tcp_sess_discard, NULL, 0, stat->sess_stat.curr_nr_tcp_sess_discard);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_tcp_sess_closed, NULL, 0, stat->sess_stat.curr_nr_tcp_sess_closed);
// UDP session
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_udp_sess_used, NULL, 0, stat->sess_stat.nr_udp_sess_used);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_udp_sess_opening, NULL, 0, stat->sess_stat.nr_udp_sess_opening);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_udp_sess_active, NULL, 0, stat->sess_stat.nr_udp_sess_active);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_udp_sess_closing, NULL, 0, stat->sess_stat.nr_udp_sess_closing);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_udp_sess_discard, NULL, 0, stat->sess_stat.nr_udp_sess_discard);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_udp_sess_closed, NULL, 0, stat->sess_stat.nr_udp_sess_closed);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.total_nr_udp_sess_used, NULL, 0, stat->sess_stat.total_nr_udp_sess_used);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_udp_sess_used, NULL, 0, stat->sess_stat.curr_nr_udp_sess_used);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_udp_sess_opening, NULL, 0, stat->sess_stat.curr_nr_udp_sess_opening);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_udp_sess_active, NULL, 0, stat->sess_stat.curr_nr_udp_sess_active);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_udp_sess_closing, NULL, 0, stat->sess_stat.curr_nr_udp_sess_closing);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_udp_sess_discard, NULL, 0, stat->sess_stat.curr_nr_udp_sess_discard);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.curr_nr_udp_sess_closed, NULL, 0, stat->sess_stat.curr_nr_udp_sess_closed);
// Evicted session
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_tcp_sess_evicted, NULL, 0, stat->sess_stat.nr_tcp_sess_evicted);
fieldstat_easy_counter_set(stat->fs, 0, stat->ids.nr_udp_sess_evicted, NULL, 0, stat->sess_stat.nr_udp_sess_evicted);