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

@@ -32,7 +32,7 @@ struct dumpfile_io
pcap_t *pcap;
struct lock_free_queue *queue[MAX_THREAD_NUM];
struct io_stat stat[MAX_THREAD_NUM];
struct packet_io_stat stat[MAX_THREAD_NUM];
uint64_t io_thread_need_exit;
uint64_t io_thread_is_runing;
uint64_t io_thread_wait_exit;
@@ -385,7 +385,7 @@ int dumpfile_io_init(struct dumpfile_io *handle, uint16_t thr_idx)
int dumpfile_io_ingress(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, int nr_pkts)
{
struct lock_free_queue *queue = handle->queue[thr_idx];
struct io_stat *stat = &handle->stat[thr_idx];
struct packet_io_stat *stat = &handle->stat[thr_idx];
struct pcap_pkt *pcap_pkt = NULL;
struct packet *pkt;
int nr_parsed = 0;
@@ -421,7 +421,7 @@ void dumpfile_io_egress(struct dumpfile_io *handle, uint16_t thr_idx, struct pac
{
int len;
struct packet *pkt = NULL;
struct io_stat *stat = &handle->stat[thr_idx];
struct packet_io_stat *stat = &handle->stat[thr_idx];
for (int i = 0; i < nr_pkts; i++)
{
@@ -446,7 +446,7 @@ void dumpfile_io_egress(struct dumpfile_io *handle, uint16_t thr_idx, struct pac
void dumpfile_io_drop(struct dumpfile_io *handle, uint16_t thr_idx, struct packet *pkts, int nr_pkts)
{
struct packet *pkt = NULL;
struct io_stat *stat = &handle->stat[thr_idx];
struct packet_io_stat *stat = &handle->stat[thr_idx];
for (int i = 0; i < nr_pkts; i++)
{
@@ -466,7 +466,7 @@ int dumpfile_io_inject(struct dumpfile_io *handle, uint16_t thr_idx, struct pack
{
int len;
struct packet *pkt = NULL;
struct io_stat *stat = &handle->stat[thr_idx];
struct packet_io_stat *stat = &handle->stat[thr_idx];
for (int i = 0; i < nr_pkts; i++)
{
@@ -495,7 +495,7 @@ void dumpfile_io_yield(struct dumpfile_io *handle, uint16_t thr_idx, uint64_t ti
return;
}
struct io_stat *dumpfile_io_stat(struct dumpfile_io *handle, uint16_t thr_idx)
struct packet_io_stat *dumpfile_io_stat(struct dumpfile_io *handle, uint16_t thr_idx)
{
return &handle->stat[thr_idx];
}