#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "MESA_htable.h" #include "field_stat2.h" #include "frag_reassembly_in.h" #include "log.h" #include "main.h" #include "MESA_handle_logger.h" #include "hard_keepalive.h" extern frag_rssb_parameter_t g_frag_run; extern frag_rssb_configure_t g_frag_cfg; extern frag_rssb_status_t g_frag_stat; extern frag_reassembly_t frag_rssb; void get_queuelog_count() { uint32_t i=0; g_frag_stat.sysinfo_stat[BIZMAN_RECV_QUEUE][QUEUE_CURRENT]=0; g_frag_stat.sysinfo_stat[APP_QUEUE][QUEUE_CURRENT]=0; g_frag_stat.sysinfo_stat[DUMPFILE_QUEUE][QUEUE_CURRENT]=0; g_frag_stat.sysinfo_stat[AV_RECORD_QUEUE][QUEUE_CURRENT]=0; g_frag_stat.sysinfo_stat[AV_DIGEST_RECORD_QUEUE][QUEUE_CURRENT]=0; if(g_frag_cfg.bizman_queue_mode) { for(i=0;(g_frag_cfg.bizman_queue_mode && i0) { sleep(g_frag_stat.sysinfo_interval); get_queuelog_count(); get_hashlog_count(); for(i=0;i0) { sleep(g_frag_stat.stat_interval); for(i=0;iflags,7); setbit(((bfd_header_t*)buf)->flags,6); if(state) { clrbit(((bfd_header_t*)buf)->flags,7); setbit(((bfd_header_t*)buf)->flags,6); printf("wait_queue is overflow, app is down.\n"); MESA_handle_runtime_log(g_frag_run.logger, RLOG_LV_FATAL, FRAG_REASSEMBLY_MODULE_NAME, "{%s:%d} wait_queue is overflow, app is down.", __FILE__,__LINE__); } else { setbit(((bfd_header_t*)buf)->flags,7); setbit(((bfd_header_t*)buf)->flags,6); } */ } void get_rssb_hashlog_count() { frag_rssb.sysinfo_stat[RSSB_CNVG_HASH][HASH_CURRENT] = MESA_htable_get_elem_num(frag_rssb.converge_hash); } void* thread_frag_rssb_sysinfo_output(void *param) { frag_rssb.syslog_column_id[NUM_CUR] = FS_register(frag_rssb.sysinfo_handle,FS_STYLE_COLUMN,FS_CALC_CURRENT,"queue_cur(hash_cur)"); frag_rssb.syslog_column_id[NUM_IN] = FS_register(frag_rssb.sysinfo_handle,FS_STYLE_COLUMN,FS_CALC_CURRENT,"queue_in(hash_num_expire)"); frag_rssb.syslog_column_id[NUM_OUT] = FS_register(frag_rssb.sysinfo_handle,FS_STYLE_COLUMN,FS_CALC_CURRENT,"queue_out(hash_time_expire)"); frag_rssb.syslog_line_id[RSSB_CNVG_QUEUE]=FS_register(frag_rssb.sysinfo_handle,FS_STYLE_LINE,FS_CALC_CURRENT,"cnvg_queue"); frag_rssb.syslog_line_id[RSSB_INDEX_QUEUE]=FS_register(frag_rssb.sysinfo_handle,FS_STYLE_LINE,FS_CALC_CURRENT,"index_queue"); frag_rssb.syslog_line_id[RSSB_WAIT_QUEUE]=FS_register(frag_rssb.sysinfo_handle,FS_STYLE_LINE,FS_CALC_CURRENT,"wait_queue"); frag_rssb.syslog_line_id[RSSB_CNVG_HASH]=FS_register(frag_rssb.sysinfo_handle,FS_STYLE_LINE,FS_CALC_CURRENT,"cnvg_hash"); FS_start(frag_rssb.sysinfo_handle); int i=0, j=0; while(frag_rssb.sysinfo_interval>0) { sleep(frag_rssb.sysinfo_interval); get_rssb_queuelog_count(); get_rssb_hashlog_count(); for(i=0;i0) { sleep(frag_rssb.stat_interval); for(i=0;i