enhance: session manager stat add tcp_segs_consumed
This commit is contained in:
@@ -430,6 +430,7 @@ static void stellar_thread_clean(struct stellar *st)
|
||||
struct stellar_runtime *runtime = &st->runtime;
|
||||
struct stellar_config *config = &st->config;
|
||||
|
||||
STELLAR_LOG_FATAL("cleaning worker thread context ...");
|
||||
for (uint16_t i = 0; i < config->pkt_io_opts.nr_threads; i++)
|
||||
{
|
||||
struct stellar_thread *thread = &runtime->threads[i];
|
||||
@@ -439,6 +440,7 @@ static void stellar_thread_clean(struct stellar *st)
|
||||
ip_reassembly_free(thread->ip_mgr);
|
||||
}
|
||||
}
|
||||
STELLAR_LOG_FATAL("worker thread context cleaned");
|
||||
}
|
||||
|
||||
static int stellar_thread_run(struct stellar *st)
|
||||
@@ -464,6 +466,7 @@ static void stellar_thread_join(struct stellar *st)
|
||||
struct stellar_runtime *runtime = &st->runtime;
|
||||
struct stellar_config *config = &st->config;
|
||||
|
||||
STELLAR_LOG_FATAL("waiting worker thread stop ...");
|
||||
for (uint16_t i = 0; i < config->pkt_io_opts.nr_threads; i++)
|
||||
{
|
||||
struct stellar_thread *thread = &runtime->threads[i];
|
||||
@@ -472,6 +475,7 @@ static void stellar_thread_join(struct stellar *st)
|
||||
usleep(1000); // 1ms
|
||||
}
|
||||
}
|
||||
STELLAR_LOG_FATAL("all worker thread stoped");
|
||||
}
|
||||
|
||||
struct stellar *stellar_new(const char *stellar_cfg_file, const char *plugin_cfg_file, const char *log_cfg_file)
|
||||
|
||||
@@ -109,6 +109,7 @@ enum METRIC_TYPE
|
||||
|
||||
// TCP segments
|
||||
METRIC_TYPE_TCP_SEGS_INPUT,
|
||||
METRIC_TYPE_TCP_SEGS_CONSUMED,
|
||||
METRIC_TYPE_TCP_SEGS_TIMEOUT,
|
||||
METRIC_TYPE_TCP_SEGS_RETRANSMITED,
|
||||
METRIC_TYPE_TCP_SEGS_OVERLAPPED,
|
||||
@@ -215,6 +216,7 @@ const char *name[] = {
|
||||
|
||||
// TCP segments
|
||||
"tcp_segs_input",
|
||||
"tcp_segs_consumed",
|
||||
"tcp_segs_timeout",
|
||||
"tcp_segs_retransmited",
|
||||
"tcp_segs_overlapped",
|
||||
@@ -522,6 +524,9 @@ void stellar_stat_output(struct stellar_stat *stat)
|
||||
case METRIC_TYPE_TCP_SEGS_INPUT:
|
||||
stat->metric_val[j] += thr_stat->session_mgr->tcp_segs_input;
|
||||
break;
|
||||
case METRIC_TYPE_TCP_SEGS_CONSUMED:
|
||||
stat->metric_val[j] += thr_stat->session_mgr->tcp_segs_consumed;
|
||||
break;
|
||||
case METRIC_TYPE_TCP_SEGS_TIMEOUT:
|
||||
stat->metric_val[j] += thr_stat->session_mgr->tcp_segs_timeout;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user