stellar stat parses output related configuration items

This commit is contained in:
luwenpeng
2024-09-02 16:03:08 +08:00
parent 9069dceae7
commit beb7d2f0ca
9 changed files with 228 additions and 294 deletions

View File

@@ -11,16 +11,27 @@ extern "C"
struct thread_stat
{
struct packet_io_stat *packet_io;
struct ip_reassembly_stat *ip_reassembly;
struct session_manager_stat *session_mgr;
struct packet_io_stat *pkt_io;
struct ip_reassembly_stat *ip_reass;
struct session_manager_stat *sess_mgr;
};
struct stellar_stat_config
{
uint16_t nr_worker_thread; // range [1, MAX_THREAD_NUM]
uint64_t merge_interval_ms; // range: [0, 60000] (ms)
uint64_t output_interval_ms; // range: [0, 60000] (ms)
};
struct stellar_stat_config *stellar_stat_config_new(const char *toml_file);
void stellar_stat_config_free(struct stellar_stat_config *cfg);
void stellar_stat_config_print(const struct stellar_stat_config *cfg);
struct stellar_stat;
struct stellar_stat *stellar_stat_new(uint16_t nr_thread);
struct stellar_stat *stellar_stat_new(const struct stellar_stat_config *cfg, uint64_t now_ms);
void stellar_stat_free(struct stellar_stat *stat);
void stellar_stat_output(struct stellar_stat *stat);
void stellar_stat_merge(struct stellar_stat *stat, const struct thread_stat *thr_stat, uint16_t thr_idx);
void stellar_stat_output(struct stellar_stat *stat, uint64_t now_ms);
void stellar_stat_merge(struct stellar_stat *stat, const struct thread_stat *thr_stat, uint16_t thr_idx, uint64_t now_ms);
void stellar_stat_print(struct stellar_stat *stat, const struct thread_stat *thr_stat, uint16_t thr_idx);
#ifdef __cplusplus