1:修改业务类型642的direction值为0-2
2:修改trafficTopicList和trafficTopicAndDomainChart接口的返回值 3:修改asn统计的返回值单位(兆) 4:修改ip范围查询使用end>=searchIp and start<=searchIp
This commit is contained in:
@@ -81,58 +81,6 @@ public class LogDataService {
|
||||
localLogJDBCByDruid.getNtcConnRecordPercentData(ntcConnRecordPercent, totalSql.toString(), true);
|
||||
return ntcConnRecordPercent;
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws ParseException {
|
||||
String asn = "s_asn ";
|
||||
|
||||
long startTime = sdf.parse("2018-12-17 21:30:00").getTime() / 1000;
|
||||
long endTime = sdf.parse("2018-12-17 21:50:00").getTime() / 1000;
|
||||
|
||||
long second = 200l;
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("SELECT SUM(s2c_pkt_num + s2c_pkt_num)*8/");
|
||||
sql.append(second);
|
||||
sql.append(" AS pps , SUM(c2s_byte_num + s2c_byte_num)*8/");
|
||||
sql.append(second);
|
||||
sql.append(" AS bps,");
|
||||
sql.append(asn);
|
||||
sql.append(
|
||||
" asn FROM tbs_ods_ntc_conn_record_log_local t WHERE found_time IN ( SELECT DISTINCT found_time FROM tbs_ods_ntc_conn_record_log_local WHERE found_time >= ");
|
||||
sql.append(startTime);
|
||||
sql.append(" and found_time< ");
|
||||
sql.append(endTime);
|
||||
StringBuffer countSql = new StringBuffer();
|
||||
countSql.append("select count(1) from (");
|
||||
countSql.append(sql);
|
||||
countSql.append(" ) group by ");
|
||||
countSql.append(asn+")");
|
||||
|
||||
Integer startNum =0;
|
||||
Integer limitCount = startNum + 20;
|
||||
|
||||
sql.append(" limit " + limitCount + " ) group by "+asn+" limit " + startNum + "," + 20);
|
||||
|
||||
|
||||
System.out.println(sql);
|
||||
System.out.println(countSql);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void getNtcAsnRecord(Page page, NtcAsnRecord ntcAsnRecord) throws Exception {
|
||||
long startTime = sdf.parse(ntcAsnRecord.getSearchFoundStartTime().toString().trim()).getTime() / 1000;
|
||||
@@ -153,7 +101,7 @@ public class LogDataService {
|
||||
StringBuffer sql = new StringBuffer();
|
||||
sql.append("SELECT SUM(s2c_pkt_num + s2c_pkt_num)*8/");
|
||||
sql.append(second);
|
||||
sql.append(" AS pps , SUM(c2s_byte_num + s2c_byte_num)*8/");
|
||||
sql.append(" AS pps , SUM(c2s_byte_num + s2c_byte_num)*8/1024/1024/");
|
||||
sql.append(second);
|
||||
sql.append(" AS bps,");
|
||||
sql.append(asn);
|
||||
@@ -170,7 +118,7 @@ public class LogDataService {
|
||||
Integer startNum = (page.getPageNo() - 1) * page.getPageSize();
|
||||
Integer limitCount = startNum + page.getPageSize();
|
||||
|
||||
sql.append(" limit " + limitCount + " ) group by "+asn+" limit " + startNum + "," + page.getPageSize());
|
||||
sql.append(" limit " + limitCount + " ) group by "+asn+" order by bps desc,pps desc limit " + startNum + "," + page.getPageSize());
|
||||
|
||||
localLogJDBCByDruid.getCount(page, countSql.toString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user