enhance: add configuration items to adjust the scheduling parameters of the main loop

This commit is contained in:
luwenpeng
2024-08-15 19:03:48 +08:00
parent 42f44b53b1
commit b0e08133b7
8 changed files with 239 additions and 26 deletions

View File

@@ -10,12 +10,29 @@ extern "C"
#include "ip_reassembly.h"
#include "session_manager.h"
struct schedule_options
{
// Note: free_expired_session_interval determines the precision of session_manager timeout
uint64_t free_expired_session_interval; // range: [1, 60000] (ms)
uint64_t free_expired_session_batch; // range: [1, 60000]
// Note: free_expired_ip_frag_interval determines the precision of ip_reassembly timeout
uint64_t free_expired_ip_frag_interval; // range: [1, 60000] (ms)
uint64_t free_expired_ip_frag_batch; // range: [1, 60000]
uint64_t merge_stat_interval; // range: [1, 60000] (ms)
uint64_t output_stat_interval; // range: [1, 60000] (ms)
uint64_t packet_io_yield_interval; // range: [1, 60000] (ms)
};
struct stellar_config
{
struct packet_io_options pkt_io_opts;
struct id_generator_options id_gen_opts;
struct ip_reassembly_options ip_reass_opts;
struct session_manager_options sess_mgr_opts;
struct schedule_options sched_opts;
};
int stellar_config_load(struct stellar_config *config, const char *file);