This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new eff39b0  Rename field name to osName in type AppServerInfo. (#1006)
eff39b0 is described below

commit eff39b0f1c6660b188c3198164649c57eb3752f5
Author: 彭勇升 pengys <[email protected]>
AuthorDate: Fri Mar 30 22:44:18 2018 +0800

    Rename field name to osName in type AppServerInfo. (#1006)
    
    #998
---
 .../apm/collector/storage/ui/server/AppServerInfo.java        | 11 ++++++-----
 .../skywalking/apm/collector/ui/service/ServerService.java    | 10 ++--------
 .../src/main/resources/ui-graphql/server-layer.graphqls       |  2 +-
 3 files changed, 9 insertions(+), 14 deletions(-)

diff --git 
a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
 
b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
index ae6ac38..d28375b 100644
--- 
a/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
+++ 
b/apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/ui/server/AppServerInfo.java
@@ -24,11 +24,12 @@ import java.util.List;
  * @author peng-yongsheng
  */
 public class AppServerInfo {
+
     private int id;
     private int applicationId;
     private String applicationCode;
     private String osInfo;
-    private String name;
+    private String osName;
     private int callsPerSec;
     private String host;
     private int pid;
@@ -66,12 +67,12 @@ public class AppServerInfo {
         this.osInfo = osInfo;
     }
 
-    public String getName() {
-        return name;
+    public String getOsName() {
+        return osName;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setOsName(String osName) {
+        this.osName = osName;
     }
 
     public int getCallsPerSec() {
diff --git 
a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
 
b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
index dd5f3ca..6ddc2d0 100644
--- 
a/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
+++ 
b/apm-collector/apm-collector-ui/collector-ui-jetty-provider/src/main/java/org/apache/skywalking/apm/collector/ui/service/ServerService.java
@@ -166,12 +166,10 @@ public class ServerService {
     private void buildAppServerInfo(List<AppServerInfo> serverInfos) {
         serverInfos.forEach(serverInfo -> {
             
serverInfo.setApplicationCode(applicationCacheService.getApplicationById(serverInfo.getApplicationId()).getApplicationCode());
-            StringBuilder nameBuilder = new StringBuilder();
-            nameBuilder.append(serverInfo.getApplicationCode());
             if (StringUtils.isNotEmpty(serverInfo.getOsInfo())) {
                 JsonObject osInfoJson = gson.fromJson(serverInfo.getOsInfo(), 
JsonObject.class);
                 if (osInfoJson.has("osName")) {
-                    serverInfo.setName(osInfoJson.get("osName").getAsString());
+                    
serverInfo.setOsName(osInfoJson.get("osName").getAsString());
                 }
                 if (osInfoJson.has("hostName")) {
                     
serverInfo.setHost(osInfoJson.get("hostName").getAsString());
@@ -184,14 +182,10 @@ public class ServerService {
                     JsonArray ipv4Array = 
osInfoJson.get("ipv4s").getAsJsonArray();
 
                     List<String> ipv4s = new LinkedList<>();
-                    ipv4Array.forEach(ipv4 -> {
-                        ipv4s.add(ipv4.getAsString());
-                        
nameBuilder.append(Const.ID_SPLIT).append(ipv4.getAsString());
-                    });
+                    ipv4Array.forEach(ipv4 -> ipv4s.add(ipv4.getAsString()));
                     serverInfo.setIpv4(ipv4s);
                 }
             }
-            serverInfo.setName(nameBuilder.toString());
         });
     }
 }
diff --git 
a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls
 
b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls
index ecf0369..808532a 100644
--- 
a/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls
+++ 
b/apm-protocol/apm-ui-protocol/src/main/resources/ui-graphql/server-layer.graphqls
@@ -21,7 +21,7 @@
 #   2. A Tomcat server instance
 type AppServerInfo {
     id: ID!
-    name: String!
+    osName: String!
     applicationId: Int!
     applicationCode: String
     callsPerSec: Int!

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to