diff options
| author | lishu <[email protected]> | 2019-03-15 16:59:18 +0800 |
|---|---|---|
| committer | lishu <[email protected]> | 2019-03-15 16:59:18 +0800 |
| commit | e2c4b4e6a104162d3234c5e6a59756da254918dc (patch) | |
| tree | f7e3ad3c893ce078b910f3c8978594dcd0830d20 /src/log.c | |
| parent | 24bc0055e363475302563635e8114fcf7f23a62a (diff) | |
1. keepalive add state
2. support UDP send in SOQ
3. 上述功能写入安装使用手册
Diffstat (limited to 'src/log.c')
| -rw-r--r-- | src/log.c | 45 |
1 files changed, 29 insertions, 16 deletions
@@ -194,23 +194,25 @@ void* thread_stat_output(void *param) char buf[32] = {0}; int send_dest_num = 0; -#if K_PROJECT - send_dest_num = g_frag_cfg.send_dest_udp_ip_num; - for(uint32_t m=0;m<g_frag_cfg.send_dest_udp_ip_num;m++) - { - inet_ntop(AF_INET, &g_frag_cfg.send_dest_udp_iplist[m], buf, sizeof(buf)); - g_frag_stat.sendlog_line_id[2*m]=FS_register(g_frag_stat.fs_handle,FS_STYLE_LINE,FS_CALC_CURRENT, "udp_send"); - g_frag_stat.sendlog_line_id[2*m+1]=FS_register(g_frag_stat.fs_handle,FS_STYLE_LINE,FS_CALC_CURRENT, "lq_count"); - } -#else - send_dest_num = g_frag_cfg.send_dest_addr_num; - for(uint32_t m=0;m<g_frag_cfg.send_dest_addr_num;m++) + if(g_frag_cfg.send_udp_switch) { - g_frag_stat.sendlog_line_id[2*m]=FS_register(g_frag_stat.fs_handle,FS_STYLE_LINE,FS_CALC_CURRENT, (char*)g_frag_cfg.send_dest_addr[m].sun_path); - g_frag_stat.sendlog_line_id[2*m+1]=FS_register(g_frag_stat.fs_handle,FS_STYLE_LINE,FS_CALC_CURRENT, "lq_count"); - } -#endif - + send_dest_num = g_frag_cfg.send_dest_udp_ip_num; + for(uint32_t m=0;m<g_frag_cfg.send_dest_udp_ip_num;m++) + { + inet_ntop(AF_INET, &g_frag_cfg.send_dest_udp_iplist[m], buf, sizeof(buf)); + g_frag_stat.sendlog_line_id[2*m]=FS_register(g_frag_stat.fs_handle,FS_STYLE_LINE,FS_CALC_CURRENT, "udp_send"); + g_frag_stat.sendlog_line_id[2*m+1]=FS_register(g_frag_stat.fs_handle,FS_STYLE_LINE,FS_CALC_CURRENT, "lq_count"); + } + } + else + { + send_dest_num = g_frag_cfg.send_dest_addr_num; + for(uint32_t m=0;m<g_frag_cfg.send_dest_addr_num;m++) + { + g_frag_stat.sendlog_line_id[2*m]=FS_register(g_frag_stat.fs_handle,FS_STYLE_LINE,FS_CALC_CURRENT, (char*)g_frag_cfg.send_dest_addr[m].sun_path); + g_frag_stat.sendlog_line_id[2*m+1]=FS_register(g_frag_stat.fs_handle,FS_STYLE_LINE,FS_CALC_CURRENT, "lq_count"); + } + } memset(buf, 0, sizeof(buf)); for(uint32_t m=0;m<g_frag_cfg.special_media_wins_port_num;m++) { @@ -369,6 +371,17 @@ void get_rssb_queuelog_count() { frag_rssb.sysinfo_stat[RSSB_WAIT_QUEUE][QUEUE_CURRENT] += MESA_lqueue_get_count(frag_rssb.wait_lq[i]); } + double queue_usage = (double)frag_rssb.sysinfo_stat[RSSB_WAIT_QUEUE][QUEUE_CURRENT]/(double)(g_frag_cfg.thread_num*frag_rssb.wait_lq_num)*100; + if(queue_usage < g_frag_cfg.bfd_threshold) + { + clrbit(g_frag_cfg.bfd_down_stat,g_frag_cfg.bfd_down_index); + } + else + { + setbit(g_frag_cfg.bfd_down_stat,g_frag_cfg.bfd_down_index); + } + g_frag_cfg.bfd_down_index++; + g_frag_cfg.bfd_down_index = g_frag_cfg.bfd_down_index%g_frag_cfg.bfd_down_num; } void get_rssb_hashlog_count() |
