|
@@ -19,6 +19,9 @@ import java.util.Map;
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class FeatureV2RemoteService {
|
|
public class FeatureV2RemoteService {
|
|
|
|
|
|
|
|
|
|
+ private static final int INFO_LOG_PROTO_THRESHOLD = 500;
|
|
|
|
|
+ private static final long INFO_LOG_COST_THRESHOLD_MS = 200L;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FeatureV2Client client;
|
|
private FeatureV2Client client;
|
|
|
|
|
|
|
@@ -29,8 +32,14 @@ public class FeatureV2RemoteService {
|
|
|
try {
|
|
try {
|
|
|
long start = System.currentTimeMillis();
|
|
long start = System.currentTimeMillis();
|
|
|
Map<String, String> result = client.multiGetFeature(protos);
|
|
Map<String, String> result = client.multiGetFeature(protos);
|
|
|
- log.debug("FeatureV2RemoteService.getFeature: protos.size={}, result.size={}, costTime={}",
|
|
|
|
|
- protos.size(), result != null ? result.size() : 0, System.currentTimeMillis() - start);
|
|
|
|
|
|
|
+ int resultSize = result != null ? result.size() : 0;
|
|
|
|
|
+ long costTime = System.currentTimeMillis() - start;
|
|
|
|
|
+ if (protos.size() > INFO_LOG_PROTO_THRESHOLD
|
|
|
|
|
+ || costTime > INFO_LOG_COST_THRESHOLD_MS
|
|
|
|
|
+ || resultSize == 0) {
|
|
|
|
|
+ log.info("FeatureV2RemoteService.getFeature: protos.size={}, result.size={}, costTime={}",
|
|
|
|
|
+ protos.size(), resultSize, costTime);
|
|
|
|
|
+ }
|
|
|
return result != null ? result : Collections.emptyMap();
|
|
return result != null ? result : Collections.emptyMap();
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("FeatureV2RemoteService.getFeature: unexpected exception, protos.size={}", protos.size(), e);
|
|
log.error("FeatureV2RemoteService.getFeature: unexpected exception, protos.size={}", protos.size(), e);
|