[collector] jsonPath解析http响应数据和calculates表达式计算实现
This commit is contained in:
@@ -98,6 +98,10 @@ public class Metrics {
|
||||
* 指标类型 number:数字 string:字符串
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 此字段是否为实例主键
|
||||
*/
|
||||
private boolean instance = false;
|
||||
/**
|
||||
* 指标单位
|
||||
*/
|
||||
|
||||
@@ -57,4 +57,9 @@ public interface CommonConstants {
|
||||
*/
|
||||
byte SUSPENDING = 0x04;
|
||||
|
||||
|
||||
/**
|
||||
* null空值占位符
|
||||
*/
|
||||
String NULL_VALUE = " ";
|
||||
}
|
||||
|
||||
30
common/src/main/java/com/usthe/common/util/CommonUtil.java
Normal file
30
common/src/main/java/com/usthe/common/util/CommonUtil.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.usthe.common.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 公共工具类
|
||||
* @author tomsun28
|
||||
* @date 2021/11/20 17:29
|
||||
*/
|
||||
@Slf4j
|
||||
public class CommonUtil {
|
||||
|
||||
/**
|
||||
* 将字符串str转换为double数字类型
|
||||
* @param str string
|
||||
* @return double 数字
|
||||
*/
|
||||
public static Double parseDoubleStr(String str) {
|
||||
if (str == null || "".equals(str)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return Double.parseDouble(str);
|
||||
} catch (Exception e) {
|
||||
log.debug(e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,6 +45,9 @@ public class IpDomainUtil {
|
||||
* @return 存在true
|
||||
*/
|
||||
public static boolean isHasSchema(String domainIp) {
|
||||
if (domainIp == null || "".equals(domainIp)) {
|
||||
return false;
|
||||
}
|
||||
return DOMAIN_SCHEMA.matcher(domainIp).matches();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user