You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/11/17 05:34:40 UTC

[GitHub] [skywalking] hailin0 commented on a change in pull request #5851: Support group in the service traffic and service list query.

hailin0 commented on a change in pull request #5851:
URL: https://github.com/apache/skywalking/pull/5851#discussion_r524888962



##########
File path: oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/manual/service/ServiceTraffic.java
##########
@@ -93,14 +101,23 @@ public ServiceTraffic map2Data(final Map<String, Object> dbMap) {
             ServiceTraffic serviceTraffic = new ServiceTraffic();
             serviceTraffic.setName((String) dbMap.get(NAME));
             serviceTraffic.setNodeType(NodeType.valueOf(((Number) dbMap.get(NODE_TYPE)).intValue()));
+            serviceTraffic.setGroup((String) dbMap.get(GROUP));
             return serviceTraffic;
         }
 
         @Override
         public Map<String, Object> data2Map(final ServiceTraffic storageData) {
+            final String serviceName = storageData.getName();
+            if (NodeType.Normal.equals(storageData.getNodeType())) {
+                int groupIdx = serviceName.indexOf(DOUBLE_COLONS_SPLIT);
+                if (groupIdx > 0) {
+                    storageData.setGroup(serviceName.substring(0, groupIdx));
+                }
+            }
             Map<String, Object> map = new HashMap<>();
-            map.put(NAME, storageData.getName());
+            map.put(NAME, serviceName);

Review comment:
       need to keep group as a service name prefix?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org