use of com.sohu.cache.entity.InstanceAlertValueResult in project cachecloud by sohutv.
the class InstanceAlertValueServiceImpl method checkStaticInstanceInfoAlert.
/**
* 检测每个实例统计信息
*
* @param standardStats
* @param instanceAlertList
* @return
*/
public List<InstanceAlertValueResult> checkStaticInstanceInfoAlert(StandardStats standardStats, List<InstanceAlert> instanceAlertList) {
List<InstanceAlertValueResult> resultList = new ArrayList<InstanceAlertValueResult>();
// 标准Redis info统计信息
String jsonInfo = standardStats.getInfoJson();
if (StringUtils.isBlank(jsonInfo)) {
return null;
}
// 转换成Map
Map<String, Object> infoMap = JsonUtil.fromJson(jsonInfo, Map.class);
if (MapUtils.isEmpty(infoMap)) {
return null;
}
// 转换成Map<String, Map<String,Object>>
for (Entry<String, Object> entry : infoMap.entrySet()) {
Object object = entry.getValue();
if (!(object instanceof Map)) {
continue;
}
Map<String, Object> sectionInfoMap = (Map<String, Object>) object;
for (Entry<String, Object> sectionInfoEntry : sectionInfoMap.entrySet()) {
String infoKey = sectionInfoEntry.getKey();
Object infoValue = sectionInfoEntry.getValue();
InstanceAlertValueResult instanceAlertValueResult = generateInstanceValueResult(instanceAlertList, infoKey, infoValue, standardStats.getIp(), standardStats.getPort());
if (instanceAlertValueResult != null) {
resultList.add(instanceAlertValueResult);
}
}
}
return resultList;
}
Aggregations