refactor stellar stat

This commit is contained in:
luwenpeng
2024-06-25 14:08:33 +08:00
parent 076b3c7b0b
commit 276bdd1b99
11 changed files with 331 additions and 520 deletions

View File

@@ -8,7 +8,6 @@
#include <sys/prctl.h>
#include "log.h"
#include "stat.h"
#include "logo.h"
#include "times.h"
#include "config.h"
@@ -16,6 +15,7 @@
#include "packet_utils.h"
#include "session_utils.h"
#include "id_generator.h"
#include "stellar_stat.h"
#include "stellar_utils.h"
#include "plugin_manager.h"
@@ -132,9 +132,9 @@ static inline void merge_thread_stat(struct stellar_thread *thread, uint64_t now
{
struct stellar_runtime *runtime = thread->runtime;
struct thread_stat thr_stat = {
packet_io_stat(runtime->packet_io, thread->idx),
ip_reassembly_stat(thread->ip_mgr),
session_manager_stat(thread->sess_mgr),
.packet_io = packet_io_stat(runtime->packet_io, thread->idx),
.ip_reassembly = ip_reassembly_stat(thread->ip_mgr),
.session_mgr = session_manager_stat(thread->sess_mgr),
};
stellar_stat_merge(runtime->stat, &thr_stat, thread->idx);
}