wu-sheng commented on a change in pull request #7399:
URL: https://github.com/apache/skywalking/pull/7399#discussion_r684044270



##########
File path: 
oap-server/analyzer/meter-analyzer/src/main/java/org/apache/skywalking/oap/meter/analyzer/Analyzer.java
##########
@@ -240,11 +242,23 @@ private void send(final AcceptableValue<?> v, final long 
time) {
     }
 
     private void generateTraffic(MeterEntity entity) {
-        ServiceTraffic s = new ServiceTraffic();
-        s.setName(requireNonNull(entity.getServiceName()));
-        s.setNodeType(NodeType.Normal);
-        
s.setTimeBucket(TimeBucket.getMinuteTimeBucket(System.currentTimeMillis()));
-        MetricsStreamProcessor.getInstance().in(s);
+        if (entity.getDetectPoint() != null) {
+            switch (entity.getDetectPoint()) {
+                case SERVER:
+                    entity.setServiceName(entity.getDestServiceName());
+                    toService(requireNonNull(entity.getDestServiceName()));
+                    serverSide(entity);
+                    break;
+                case CLIENT:
+                    entity.setServiceName(entity.getSourceServiceName());
+                    toService(requireNonNull(entity.getSourceServiceName()));
+                    clientSide(entity);
+                    break;
+            }

Review comment:
       @kezhenxu94 This seems a logical decision only. Actually all traffic 
sources of services could be generated by the entity level metrics, rather than 
relation level.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to