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

hanahmily pushed a commit to branch topology/layout
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking-ui.git

commit 157cb94e1aab1b1e2d88121795276fa85140dad7
Author: hanahmily <hanahm...@gmail.com>
AuthorDate: Wed Mar 7 14:45:28 2018 +0800

    Topology test
---
 mock/topology.js | 189 +++++++++++++++++++++++++------------------------------
 1 file changed, 87 insertions(+), 102 deletions(-)

diff --git a/mock/topology.js b/mock/topology.js
index 6a8f3b4..9c9c50d 100644
--- a/mock/topology.js
+++ b/mock/topology.js
@@ -15,6 +15,22 @@
  * limitations under the License.
  */
 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 
 import mockjs from 'mockjs';
 
@@ -23,108 +39,77 @@ export default {
     res.json(mockjs.mock(
       {
         data: {
-          getClusterTopology: () => {
-            const application = mockjs.mock({
-              'nodes|2': [
-                {
-                  'id|+1': 1,
-                  name: '@name',
-                  'type|1': ['DUBBO', 'tomcat', 'SPRINGMVC'],
-                  'callsPerSec|1000-2000': 1,
-                  'sla|1-100.1-2': 1,
-                  'apdex|0.2': 1,
-                  'avgResponseTime|500-1000': 1,
-                  'isAlarm|1': true,
-                  'numOfServer|1-100': 1,
-                  'numOfServerAlarm|1-100': 1,
-                  'numOfServiceAlarm|1-100': 1,
-                },
-              ],
-            });
-            const users = mockjs.mock({
-              nodes: [
-                {
-                  id: 100,
-                  name: 'User',
-                  type: 'USER',
-                },
-              ],
-            });
-            const resources = mockjs.mock({
-              'nodes|5': [
-                {
-                  'id|+1': 200,
-                  name: '@name',
-                  'type|1': ['Oracle', 'MYSQL', 'REDIS'],
-                },
-              ],
-            });
-            const nodes = users.nodes.concat(application.nodes, 
resources.nodes);
-            const userConnectApplication = mockjs.mock({
-              calls: [
-                {
-                  source: 100,
-                  target: 1,
-                  'isAlert|1': true,
-                  'callType|1': ['rpc', 'http', 'dubbo'],
-                  'callsPerSec|100-2000': 1,
-                  'avgResponseTime|500-5000': 1,
-                },
-                {
-                  source: 1,
-                  target: 2,
-                  'isAlert|1': true,
-                  'callType|1': ['rpc', 'http', 'dubbo'],
-                  'callsPerSec|100-2000': 1,
-                  'avgResponseTime|500-5000': 1,
-                },
-                {
-                  source: 1,
-                  target: 200,
-                  'isAlert|1': true,
-                  'callType|1': ['rpc', 'http', 'dubbo'],
-                  'callsPerSec|100-2000': 1,
-                  'avgResponseTime|500-5000': 1,
-                },
-                {
-                  source: 1,
-                  target: 201,
-                  'isAlert|1': true,
-                  'callType|1': ['rpc', 'http', 'dubbo'],
-                  'callsPerSec|100-2000': 1,
-                  'avgResponseTime|500-5000': 1,
-                },
-                {
-                  source: 2,
-                  target: 202,
-                  'isAlert|1': true,
-                  'callType|1': ['rpc', 'http', 'dubbo'],
-                  'callsPerSec|100-2000': 1,
-                  'avgResponseTime|500-5000': 1,
-                },
-                {
-                  source: 2,
-                  target: 203,
-                  'isAlert|1': true,
-                  'callType|1': ['rpc', 'http', 'dubbo'],
-                  'callsPerSec|100-2000': 1,
-                  'avgResponseTime|500-5000': 1,
-                },
-                {
-                  source: 2,
-                  target: 204,
-                  'isAlert|1': true,
-                  'callType|1': ['rpc', 'http', 'dubbo'],
-                  'callsPerSec|100-2000': 1,
-                  'avgResponseTime|500-5000': 1,
-                },
-              ],
-            });
-            return {
-              nodes,
-              calls: userConnectApplication.calls,
-            };
-          },
+          "getClusterTopology":{  
+            "nodes":[  
+               {  
+                  "id":"-1",
+                  "name":"kafka-producer",
+                  "type":"SpringMVC",
+                  "sla":100,
+                  "callsPerSec":0,
+                  "avgResponseTime":174,
+                  "apdex":100,
+                  "isAlarm":false,
+                  "numOfServer":1,
+                  "numOfServerAlarm":0,
+                  "numOfServiceAlarm":0
+               },
+               {  
+                  "id":"2",
+                  "name":"kafka-consumer",
+                  "type":"Kafka",
+                  "sla":100,
+                  "callsPerSec":0,
+                  "avgResponseTime":22,
+                  "apdex":100,
+                  "isAlarm":false,
+                  "numOfServer":1,
+                  "numOfServerAlarm":0,
+                  "numOfServiceAlarm":0
+               },
+               {  
+                  "id":"-2",
+                  "name":"127.0.0.1:9092",
+                  "type":"Kafka"
+               },
+               {  
+                  "id":"-2",
+                  "name":"127.0.0.1:9092",
+                  "type":"Kafka"
+               },
+               {  
+                  "id":"1",
+                  "name":"User",
+                  "type":"USER"
+               }
+            ],
+            "calls":[  
+               {  
+                  "source":"-1",
+                  "target":"-2",
+                  "isAlert":false,
+                  "callType":"Kafka",
+                  "callsPerSec":0,
+                  "avgResponseTime":68
+               },
+               {  
+                  "source":"-2",
+                  "target":"2",
+                  "isAlert":false,
+                  "callType":"Kafka",
+                  "callsPerSec":0,
+                  "avgResponseTime":22
+               },
+               {  
+                  "source":"1",
+                  "target":"-1",
+                  "isAlert":false,
+                  "callType":"",
+                  "callsPerSec":0,
+                  "avgResponseTime":174
+               }
+            ]
+         }
         },
       }
     ));

-- 
To stop receiving notification emails like this one, please contact
hanahm...@apache.org.

Reply via email to