一、日志接口添加查询条件

ntcAppLogs :searchLabelAppId和searchLabelProtoId
ntcBgpLogs :searchAsNum
ntcFtpLogs :searchFtpUrl
ntcP2pLogs :searchP2pFileId和searchP2pKeyword
ntcStreamMediaLogs :searchUrl
ntcVoipLogs :
	searchCallingAccount 和searchCalledAccount;
ntcDdosLogs : searchAttackType
二、修改App活跃IP top100查询接口,添加指标(searchQuota: 1:连接数 2:包数
3:字节数,默认为1),返回数据中添加占比
This commit is contained in:
zhangdongxu
2019-01-08 18:16:05 +08:00
parent 39a86d948b
commit f51120bd33
12 changed files with 212 additions and 24 deletions

View File

@@ -1,5 +1,6 @@
package com.nis.web.service.restful;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -15,6 +16,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -565,7 +567,7 @@ public class DashboardService extends BaseService {
int index = 0;
for (int i = 0; i < dateRangeList.size(); i++) {
// 存放一个时间点中每个IP的总数
Map<String, Long> ipCountMap = new HashMap<String, Long>();
Map<String, Long> ipCountMap = new TreeMap<String, Long>();
Date date = dateRangeList.get(i);
for (int j = index; j < ipInfoList.size(); j++) {
TrafficIpActiveStatistic ipInfo = ipInfoList.get(j);
@@ -1695,8 +1697,18 @@ public class DashboardService extends BaseService {
}
public List<AppConnRecordStatistic> appConnRecordTop100(AppConnRecordStatistic entity) {
DecimalFormat df = new DecimalFormat("##.##");
List<AppConnRecordStatistic> list = new ArrayList<AppConnRecordStatistic>();
list = trafficAppStatisticDao.appConnRecordTop100(entity);
if (!StringUtil.isEmpty(list)) {
//统计总量
AppConnRecordStatistic sum = trafficAppStatisticDao.appConnRecordTotal(entity).get(0);
for (AppConnRecordStatistic obj : list) {
obj.setBytePercent(df.format(obj.getByteNum()/sum.getByteNum()*100));
obj.setPktPercent(df.format(obj.getPktNum()/sum.getPktNum()*100));
obj.setLogPercent(df.format(obj.getLogNum()/sum.getLogNum()*100));
}
}
return list;
}
}