Commit 02b72d3e authored by wangwei's avatar wangwei

增加warn抽样日志

parent 76853267
buildscript { buildscript {
ext["duibaExtVersion"] = "2.0.0-h45" ext["duibaExtVersion"] = "2.0.0-h86"
ext["springBootVersion"] = "2.2.7.RELEASE" ext["springBootVersion"] = "2.2.7.RELEASE"
ext["springCloudVersion"] = "Hoxton.SR6" ext["springCloudVersion"] = "Hoxton.SR6"
ext["hazelcast.version"] = "3.11" ext["hazelcast.version"] = "3.11"
...@@ -38,7 +38,7 @@ allprojects { ...@@ -38,7 +38,7 @@ allprojects {
} }
group = "cn.com.duiba.boot" group = "cn.com.duiba.boot"
version = "0.0.57" version = "0.0.58"
} }
subprojects { subprojects {
......
...@@ -92,6 +92,24 @@ public class SamplerLog { ...@@ -92,6 +92,24 @@ public class SamplerLog {
info(format, arguments); info(format, arguments);
} }
public static void warn(String format, Object... arguments) {
try {
if (infoFlag()) {
logger.warn("samplingId-" + LOCAL.get() + "," + format, arguments);
}
} catch (Exception e) {
logger.warn("SamplerLog info error", e);
}
}
public static void warn(boolean fullFlag, String format, Object... arguments) {
if (fullFlag) {
logger.warn(format, arguments);
return;
}
warn(format, arguments);
}
public static void end() { public static void end() {
LOCAL.remove(); LOCAL.remove();
} }
......
...@@ -225,8 +225,8 @@ public class RedisBloomHandler<K, V> { ...@@ -225,8 +225,8 @@ public class RedisBloomHandler<K, V> {
* @return * @return
*/ */
public Integer saveBloom(String key, String value, Integer levelCount) { public Integer saveBloom(String key, String value, Integer levelCount) {
String luaText = "local a = " + (levelCount + 1) + "\n" + String luaText = "local a = " + levelCount + "\n" +
"for i = 1, #(ARGV)+1 do\n" + "for i = 1, (ARGV[2]) do\n" +
" if(redis.call('BF.ADD', KEYS[1], (ARGV[1] .. '_' .. i)) == 1) then\n" + " if(redis.call('BF.ADD', KEYS[1], (ARGV[1] .. '_' .. i)) == 1) then\n" +
" a = i;\n" + " a = i;\n" +
" break;\n" + " break;\n" +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment