提交 3e2fb788 编写于 作者: Q QIliang 提交者: wu-sheng

Scope needs to be replaced with entityId (#2742)

"scope" can not find in serviceInventoryCache, serviceInstanceInventoryCache or endpointInventoryCache.
It needs to be replaced with entityId
上级 d95ab263
......@@ -35,11 +35,14 @@ public class MetricFormatter {
protected String getEntityName(MetricsMetaInfo meta) {
int scope = meta.getScope();
if (DefaultScopeDefine.inServiceCatalog(scope)) {
return serviceInventoryCache.get(scope).getName();
int entityId = Integer.valueOf(meta.getId());
return serviceInventoryCache.get(entityId).getName();
} else if (DefaultScopeDefine.inServiceInstanceCatalog(scope)) {
return serviceInstanceInventoryCache.get(scope).getName();
int entityId = Integer.valueOf(meta.getId());
return serviceInstanceInventoryCache.get(entityId).getName();
} else if (DefaultScopeDefine.inEndpointCatalog(scope)) {
return endpointInventoryCache.get(scope).getName();
int entityId = Integer.valueOf(meta.getId());
return endpointInventoryCache.get(entityId).getName();
} else if (scope == DefaultScopeDefine.ALL) {
return "";
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册