wu-sheng closed pull request #1006: Rename field name to osName in type 
AppServerInfo.
URL: https://github.com/apache/incubator-skywalking/pull/1006
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 ae6ac38db..d28375bf5 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 @@
  * @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 void setOsInfo(String osInfo) {
         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 dd5f3ca05..6ddc2d0c7 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 MemoryTrend getMemoryTrend(int instanceId, Step 
step, long startTimeBucke
     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 @@ private void buildAppServerInfo(List<AppServerInfo> 
serverInfos) {
                     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 ecf0369ff..808532a23 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!


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to