Stellar output statistics

This commit is contained in:
luwenpeng
2024-04-16 14:12:41 +08:00
parent 17f5d338de
commit d878849c3a
18 changed files with 485 additions and 30 deletions

View File

@@ -20,7 +20,7 @@ struct dumpfile_io
pcap_t *pcap;
struct lock_free_queue *queue[MAX_THREAD_NUM];
struct packet_stat stat;
struct io_stat stat;
uint64_t io_thread_need_exit;
uint64_t io_thread_is_runing;
};
@@ -193,7 +193,7 @@ void dumpfile_io_free(struct dumpfile_io *handle)
}
}
struct packet_stat *dumpfile_io_stat(struct dumpfile_io *handle)
struct io_stat *dumpfile_io_get_stat(struct dumpfile_io *handle)
{
return &handle->stat;
}

View File

@@ -11,7 +11,7 @@ extern "C"
struct dumpfile_io;
struct dumpfile_io *dumpfile_io_new(const char *directory, uint8_t nr_threads);
void dumpfile_io_free(struct dumpfile_io *handle);
struct packet_stat *dumpfile_io_stat(struct dumpfile_io *handle);
struct io_stat *dumpfile_io_get_stat(struct dumpfile_io *handle);
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);

View File

@@ -15,7 +15,7 @@ struct marsio_io
struct mr_vdev *mr_dev;
struct mr_sendpath *mr_path;
struct packet_stat stat;
struct io_stat stat;
};
/******************************************************************************
@@ -118,7 +118,7 @@ void marsio_io_free(struct marsio_io *handle)
}
}
struct packet_stat *marsio_io_stat(struct marsio_io *handle)
struct io_stat *marsio_io_get_stat(struct marsio_io *handle)
{
return &handle->stat;
}

View File

@@ -11,7 +11,7 @@ extern "C"
struct marsio_io;
struct marsio_io *marsio_io_new(const char *app_symbol, const char *dev_symbol, uint16_t *cpu_mask, uint8_t nr_threads);
void marsio_io_free(struct marsio_io *handle);
struct packet_stat *marsio_io_stat(struct marsio_io *handle);
struct io_stat *marsio_io_get_stat(struct marsio_io *handle);
int marsio_io_init(struct marsio_io *handle, uint16_t thr_idx);
int marsio_io_ingress(struct marsio_io *handle, uint16_t thr_idx, struct packet *pkts, int nr_pkts);

View File

@@ -58,15 +58,15 @@ void packet_io_free(struct packet_io *packet_io)
}
}
struct packet_stat *packet_io_stat(struct packet_io *packet_io)
struct io_stat *packet_io_get_stat(struct packet_io *packet_io)
{
if (packet_io->mode == PACKET_IO_MARSIO)
{
return marsio_io_stat(packet_io->marsio);
return marsio_io_get_stat(packet_io->marsio);
}
else
{
return dumpfile_io_stat(packet_io->dumpfile);
return dumpfile_io_get_stat(packet_io->dumpfile);
}
}

View File

@@ -14,7 +14,7 @@ extern "C"
#define PACKET_IO_LOG_ERROR(format, ...) LOG_ERROR("packet_io", format, ##__VA_ARGS__)
#define PACKET_IO_LOG_DEBUG(format, ...) LOG_DEBUG("packet_io", format, ##__VA_ARGS__)
struct packet_stat
struct io_stat
{
// device packet
uint64_t dev_rx_pkts;
@@ -66,7 +66,7 @@ struct packet_io_options
struct packet_io;
struct packet_io *packet_io_new(struct packet_io_options *opts);
void packet_io_free(struct packet_io *packet_io);
struct packet_stat *packet_io_stat(struct packet_io *packet_io);
struct io_stat *packet_io_get_stat(struct packet_io *packet_io);
int packet_io_init(struct packet_io *packet_io, uint16_t thr_idx);
int packet_io_ingress(struct packet_io *packet_io, uint16_t thr_idx, struct packet *pkts, int nr_pkts);