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

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


The following commit(s) were added to refs/heads/update-antdpro by this push:
     new 704f4e1  Add mock
704f4e1 is described below

commit 704f4e146f95f3c82a66fba2bcf161b51f67a3a2
Author: hanahmily <[email protected]>
AuthorDate: Mon Feb 26 11:32:37 2018 +0800

    Add mock
---
 .roadhogrc.mock.js  | 151 ++++++++--------------------------------------------
 mock/alarm.js       |  93 ++++++++++++++++++++++++++++++++
 mock/application.js |  99 ++++++++++++++++++++++++++++++++++
 mock/dashboard.js   |  27 ++++++++++
 mock/server.js      |  49 +++++++++++++++++
 mock/service.js     |  93 ++++++++++++++++++++++++++++++++
 mock/topology.js    | 114 +++++++++++++++++++++++++++++++++++++++
 mock/trace.js       | 148 ++++++++++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 646 insertions(+), 128 deletions(-)

diff --git a/.roadhogrc.mock.js b/.roadhogrc.mock.js
index 076ee0c..2b9857d 100644
--- a/.roadhogrc.mock.js
+++ b/.roadhogrc.mock.js
@@ -1,137 +1,32 @@
 import mockjs from 'mockjs';
 import { getRule, postRule } from './mock/rule';
-import { getActivities, getNotice, getFakeList } from './mock/api';
-import { getFakeChartData } from './mock/chart';
 import { imgMap } from './mock/utils';
-import { getProfileBasicData } from './mock/profile';
-import { getProfileAdvancedData } from './mock/profile';
 import { getNotices } from './mock/notices';
-import { format, delay } from 'roadhog-api-doc';
+import { delay } from 'roadhog-api-doc';
+import { getDashboard } from './mock/dashboard';
+import { getTopology } from './mock/topology';
+import { getAllApplication, getApplication } from './mock/application';
+import { searchServer, getServer } from './mock/server';
+import { searchService, getService } from './mock/service';
+import { getAlarm, getNoticeAlarm } from './mock/alarm';
+import { getAllApplication as getAllApplicationForTrace, getTrace, getSpans } 
from './mock/trace'
 
-// 是否禁用代理
-const noProxy = process.env.NO_PROXY === 'true';
+const noMock = process.env.NO_MOCK === 'true';
 
-// 代码中会兼容本地 service mock 以及部署站点的静态数据
 const proxy = {
-  // 支持值为 Object 和 Array
-  'GET /api/currentUser': {
-    $desc: "获取当前用户接口",
-    $params: {
-      pageSize: {
-        desc: '分页',
-        exp: 2,
-      },
-    },
-    $body: {
-      name: 'Serati Ma',
-      avatar: 
'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
-      userid: '00000001',
-      notifyCount: 12,
-    },
-  },
-  // GET POST 可省略
-  'GET /api/users': [{
-    key: '1',
-    name: 'John Brown',
-    age: 32,
-    address: 'New York No. 1 Lake Park',
-  }, {
-    key: '2',
-    name: 'Jim Green',
-    age: 42,
-    address: 'London No. 1 Lake Park',
-  }, {
-    key: '3',
-    name: 'Joe Black',
-    age: 32,
-    address: 'Sidney No. 1 Lake Park',
-  }],
-  'GET /api/project/notice': getNotice,
-  'GET /api/activities': getActivities,
-  'GET /api/rule': getRule,
-  'POST /api/rule': {
-    $params: {
-      pageSize: {
-        desc: '分页',
-        exp: 2,
-      },
-    },
-    $body: postRule,
-  },
-  'POST /api/forms': (req, res) => {
-    res.send({ message: 'Ok' });
-  },
-  'GET /api/tags': mockjs.mock({
-    'list|100': [{ name: '@city', 'value|1-100': 150, 'type|0-2': 1 }]
-  }),
-  'GET /api/fake_list': getFakeList,
-  'GET /api/fake_chart_data': getFakeChartData,
-  'GET /api/profile/basic': getProfileBasicData,
-  'GET /api/profile/advanced': getProfileAdvancedData,
-  'POST /api/login/account': (req, res) => {
-    const { password, userName, type } = req.body;
-    if(password === '888888' && userName === 'admin'){
-      res.send({
-        status: 'ok',
-        type,
-        currentAuthority: 'admin'
-      });
-      return ;
-    }
-    if(password === '123456' && userName === 'user'){
-      res.send({
-        status: 'ok',
-        type,
-        currentAuthority: 'user'
-      });
-      return ;
-    }
-    res.send({
-      status: 'error',
-      type,
-      currentAuthority: 'guest'
-    });
-  },
-  'POST /api/register': (req, res) => {
-    res.send({ status: 'ok', currentAuthority: 'user' });
-  },
-  'GET /api/notices': getNotices,
-  'GET /api/500': (req, res) => {
-    res.status(500).send({
-      "timestamp": 1513932555104,
-      "status": 500,
-      "error": "error",
-      "message": "error",
-      "path": "/base/category/list"
-    });
-  },
-  'GET /api/404': (req, res) => {
-    res.status(404).send({
-      "timestamp": 1513932643431,
-      "status": 404,
-      "error": "Not Found",
-      "message": "No message available",
-      "path": "/base/category/list/2121212"
-    });
-  },
-  'GET /api/403': (req, res) => {
-    res.status(403).send({
-      "timestamp": 1513932555104,
-      "status": 403,
-      "error": "Unauthorized",
-      "message": "Unauthorized",
-      "path": "/base/category/list"
-    });
-  },
-  'GET /api/401': (req, res) => {
-    res.status(401).send({
-      "timestamp": 1513932555104,
-      "status": 401,
-      "error": "Unauthorized",
-      "message": "Unauthorized",
-      "path": "/base/category/list"
-    });
-  },
+  'POST /api/dashboard': getDashboard,
+  'POST /api/topology': getTopology,
+  'POST /api/application/options': getAllApplication,
+  'POST /api/application': getApplication,
+  'POST /api/server/search': searchServer,
+  'POST /api/server': getServer,
+  'POST /api/service/search': searchService,
+  'POST /api/service': getService,
+  'POST /api/alarm': getAlarm,
+  'POST /api/notice': getNoticeAlarm,
+  'POST /api/trace/options': getAllApplicationForTrace,
+  'POST /api/trace': getTrace,
+  'POST /api/spans': getSpans,
 };
 
-export default noProxy ? {} : delay(proxy, 1000);
+export default noMock ? {} : delay(proxy, 1000);
diff --git a/mock/alarm.js b/mock/alarm.js
new file mode 100644
index 0000000..e72f9bc
--- /dev/null
+++ b/mock/alarm.js
@@ -0,0 +1,93 @@
+import mockjs from 'mockjs';
+
+export default {
+  getNoticeAlarm(req, res) {
+    return res.json(mockjs.mock(
+      {
+        data: {
+          applicationAlarmList: {
+            'items|5': [{
+              'key|+1': 1,
+              title: '@name',
+              startTime: '@datetime("yyyy-MM-dd HH:mm:ss")',
+              'causeType|1': ['LOW_SUCCESS_RATE', 'SLOW_RESPONSE'],
+              alarmType: 'APPLICATION',
+            }],
+            total: '@natural(5, 50)',
+          },
+          serverAlarmList: {
+            'items|5': [{
+              'key|+1': 1,
+              title: '@name',
+              startTime: '@datetime("yyyy-MM-dd HH:mm:ss")',
+              'causeType|1': ['LOW_SUCCESS_RATE', 'SLOW_RESPONSE'],
+              alarmType: 'SERVER',
+            }],
+            total: '@natural(5, 50)',
+          },
+        },
+      }
+    ));
+  },
+  getAlarm(req, res) {
+    const { variables: { alarmType } } = req.body;
+    switch (alarmType) {
+      case 'APPLICATION':
+        return res.json(mockjs.mock(
+          {
+            data: {
+              loadAlarmList: {
+                'items|10': [{
+                  'key|+1': 1,
+                  title: '@name',
+                  content: '@paragraph(1)',
+                  startTime: '@datetime("yyyy-MM-dd HH:mm:ss")',
+                  'causeType|1': ['LOW_SUCCESS_RATE', 'SLOW_RESPONSE'],
+                  alarmType: 'APPLICATION',
+                }],
+                total: '@natural(5, 50)',
+              },
+            },
+          }
+        ));
+      case 'SERVER':
+        return res.json(mockjs.mock(
+          {
+            data: {
+              loadAlarmList: {
+                'items|10': [{
+                  'key|+1': 1,
+                  title: '@name',
+                  content: '@paragraph(1)',
+                  startTime: '@datetime("yyyy-MM-dd HH:mm:ss")',
+                  'causeType|1': ['LOW_SUCCESS_RATE', 'SLOW_RESPONSE'],
+                  alarmType: 'SERVER',
+                }],
+                total: '@natural(5, 50)',
+              },
+            },
+          }
+        ));
+      case 'SERVICE':
+        return res.json(mockjs.mock(
+          {
+            data: {
+              loadAlarmList: {
+                'items|10': [{
+                  'key|+1': 1,
+                  title: '@name',
+                  content: '@paragraph(1)',
+                  startTime: '@datetime("yyyy-MM-dd HH:mm:ss")',
+                  'causeType|1': ['LOW_SUCCESS_RATE', 'SLOW_RESPONSE'],
+                  alarmType: 'SERVICE',
+                }],
+                total: '@natural(5, 50)',
+              },
+            },
+          }
+        ));
+      default:
+        return null;
+    }
+  },
+};
diff --git a/mock/application.js b/mock/application.js
new file mode 100644
index 0000000..f4e67ea
--- /dev/null
+++ b/mock/application.js
@@ -0,0 +1,99 @@
+import mockjs from 'mockjs';
+
+export default {
+  getAllApplication(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          'applicationId|20-50': [{ 'key|+1': 3, label: function() { return 
`app-${this.key}`; } }], // eslint-disable-line
+        },
+      }
+    ));
+  },
+  getApplication(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          'getSlowService|10': [{ 'key|+1': 1, name: '@name', 
'avgResponseTime|200-1000': 1 }],
+          'getServerThroughput|10': [{ 'key|+1': 1, name: '@name', 
'tps|100-10000': 1 }],
+          getApplicationTopology: () => {
+            const application = mockjs.mock({
+              nodes: [
+                {
+                  id: 1,
+                  name: '@name',
+                  'type|1': ['DUBBO', 'tomcat', 'SPRINGMVC'],
+                  'calls|1000-2000': 1,
+                  'sla|1-100.1-2': 1,
+                  'apdex|0.2': 1,
+                  'numOfServer|1-100': 1,
+                  'numOfServerAlarm|1-100': 1,
+                  'numOfServiceAlarm|1-100': 1,
+                  'isIncomingNode|1': true,
+                },
+              ],
+            });
+            const resources = mockjs.mock({
+              'nodes|5': [
+                {
+                  'id|+1': 200,
+                  name: '@name',
+                  'type|1': ['Oracle', 'MYSQL', 'REDIS'],
+                },
+              ],
+            });
+            const nodes = application.nodes.concat(resources.nodes);
+            const userConnectApplication = mockjs.mock({
+              calls: [
+                {
+                  source: 1,
+                  target: 200,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 1,
+                  target: 201,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 1,
+                  target: 202,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 1,
+                  target: 203,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 1,
+                  target: 204,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+              ],
+            });
+            return {
+              nodes,
+              calls: userConnectApplication.calls,
+            };
+          },
+        },
+      }
+    ));
+  },
+};
diff --git a/mock/dashboard.js b/mock/dashboard.js
new file mode 100644
index 0000000..479e595
--- /dev/null
+++ b/mock/dashboard.js
@@ -0,0 +1,27 @@
+import mockjs from 'mockjs';
+
+export default {
+  getDashboard(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          getClusterBrief: {
+            'numOfApplication|1-100': 1,
+            'numOfService|1-100': 1,
+            'numOfDatabase|1-100': 1,
+            'numOfCache|1-100': 1,
+            'numOfMQ|1-100': 1,
+          },
+          getAlarmTrend: {
+            'numOfAlarmRate|60': ['@natural(0, 9999)'],
+          },
+          getConjecturalApps: {
+            'apps|3-5': [{ 'name|1': ['Oracle', 'MySQL', 'ActiveMQ', 'Redis', 
'Memcache', 'SQLServer'], num: '@natural(1, 20)' }],
+          },
+          'getTopNSlowService|10': [{ 'key|+1': 1, name: '@url', 
'avgResponseTime|200-1000': 1 }],
+          'getTopNApplicationThroughput|10': [{ 'key|+1': 1, applicationCode: 
'@name', 'tps|100-10000': 1 }],
+        },
+      }
+    ));
+  },
+};
diff --git a/mock/server.js b/mock/server.js
new file mode 100644
index 0000000..be891ca
--- /dev/null
+++ b/mock/server.js
@@ -0,0 +1,49 @@
+import mockjs from 'mockjs';
+
+export default {
+  searchServer(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          'searchServer|5': [
+            {
+              'key|+1': 3,
+              label: function() { return `server-${this.key}`; }, // 
eslint-disable-line
+              os: 'Mac-@name',
+              host: 'WORKSAPCE-@name',
+              pid: '@natural',
+              'ipv4|1-3': ['@ip'],
+            },
+          ],
+        },
+      }
+    ));
+  },
+  getServer(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          getServerResponseTimeTrend: {
+            'trendList|60': ['@natural(100, 1000)'],
+          },
+          getServerTPSTrend: {
+            'trendList|60': ['@natural(500, 10000)'],
+          },
+          getCPUTrend: {
+            'cost|60': ['@natural(0, 99)'],
+          },
+          getMemoryTrend: {
+            'heap|60': ['@natural(500, 900)'],
+            'maxHeap|60': [1000],
+            'noheap|60': ['@natural(100, 200)'],
+            'maxNoheap|60': [300],
+          },
+          getGCTrend: {
+            'youngGC|60': ['@natural(200, 300)'],
+            'oldGC|60': ['@natural(10,100)'],
+          },
+        },
+      }
+    ));
+  },
+};
diff --git a/mock/service.js b/mock/service.js
new file mode 100644
index 0000000..57d7879
--- /dev/null
+++ b/mock/service.js
@@ -0,0 +1,93 @@
+import mockjs from 'mockjs';
+
+export default {
+  searchService(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          'searchService|5': [
+            {
+              'key|+1': 3,
+              label: function() { return `service-${this.key}`; }, // 
eslint-disable-line
+            },
+          ],
+        },
+      }
+    ));
+  },
+  getService(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          'searchService|5': [{}],
+          getServiceResponseTimeTrend: {
+            'trendList|60': ['@natural(100, 1000)'],
+          },
+          getServiceTPSTrend: {
+            'trendList|60': ['@natural(500, 10000)'],
+          },
+          getServiceSLATrend: {
+            'trendList|60': ['@natural(8000, 10000)'],
+          },
+          getServiceTopology: () => {
+            const upNodes = mockjs.mock({
+              'nodes|1-5': [
+                {
+                  'id|+1': 100,
+                  name: '@name',
+                  'type|1': ['DUBBO', 'USER', 'SPRINGMVC'],
+                  'calls|1000-2000': 1,
+                  'sla|1-100.1-2': 1,
+                  'apdex|0.2': 1,
+                  'numOfServiceAlarm|1-100': 1,
+                },
+              ],
+            });
+            const centerNodes = mockjs.mock({
+              nodes: [
+                {
+                  'id|+1': 1,
+                  name: '@name',
+                  'type|1': ['DUBBO', 'tomcat', 'SPRINGMVC'],
+                  'calls|1000-2000': 1,
+                  'sla|1-100.1-2': 1,
+                  'apdex|0.2': 1,
+                  'numOfServiceAlarm|1-100': 1,
+                },
+              ],
+            });
+            const downNodes = mockjs.mock({
+              'nodes|2-5': [
+                {
+                  'id|+1': 200,
+                  name: '@name',
+                  'type|1': ['Oracle', 'MYSQL', 'REDIS'],
+                },
+              ],
+            });
+            const nodes = upNodes.nodes.concat(centerNodes.nodes, 
downNodes.nodes);
+            const calls = upNodes.nodes.map(node => (mockjs.mock({
+              source: node.id,
+              target: 1,
+              'isAlarm|1': true,
+              'callType|1': ['rpc', 'http', 'dubbo'],
+              'callsPerSec|100-2000': 1,
+              'responseTimePerSec|500-5000': 1,
+            }))).concat(downNodes.nodes.map(node => (mockjs.mock({
+              source: 1,
+              target: node.id,
+              'isAlarm|1': true,
+              'callType|1': ['rpc', 'http', 'dubbo'],
+              'callsPerSec|100-2000': 1,
+              'responseTimePerSec|500-5000': 1,
+            }))));
+            return {
+              nodes,
+              calls,
+            };
+          },
+        },
+      }
+    ));
+  },
+};
diff --git a/mock/topology.js b/mock/topology.js
new file mode 100644
index 0000000..2e56c10
--- /dev/null
+++ b/mock/topology.js
@@ -0,0 +1,114 @@
+import mockjs from 'mockjs';
+
+export default {
+  getTopology(req, res) {
+    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,
+                  'responseTimePerSec|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,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 1,
+                  target: 2,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 1,
+                  target: 200,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 1,
+                  target: 201,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 2,
+                  target: 202,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 2,
+                  target: 203,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+                {
+                  source: 2,
+                  target: 204,
+                  'isAlarm|1': true,
+                  'callType|1': ['rpc', 'http', 'dubbo'],
+                  'callsPerSec|100-2000': 1,
+                  'responseTimePerSec|500-5000': 1,
+                },
+              ],
+            });
+            return {
+              nodes,
+              calls: userConnectApplication.calls,
+            };
+          },
+        },
+      }
+    ));
+  },
+};
diff --git a/mock/trace.js b/mock/trace.js
new file mode 100644
index 0000000..5b3514a
--- /dev/null
+++ b/mock/trace.js
@@ -0,0 +1,148 @@
+import mockjs from 'mockjs';
+
+export default {
+  getAllApplication(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          'applicationCodes|20-50': [{ 'key|+1': 3, label: function() { return 
`app-${this.key}`; } }],  // eslint-disable-line
+        },
+      }
+    ));
+  },
+  getTrace(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          queryBasicTraces: {
+            'traces|10': [{
+              operationName: '@url',
+              duration: '@natural(100, 1000)',
+              start: '@datetime',
+              'isError|1': true,
+              traceId: '@guid',
+            }],
+            total: '@natural(5, 50)',
+          },
+        },
+      }
+    ));
+  },
+  getSpans(req, res) {
+    res.json(mockjs.mock(
+      {
+        data: {
+          queryTrace: {
+            spans: [
+              {
+                spanId: 1,
+                segmentId: 1,
+                startTime: 1516151345000,
+                applicationCode: 'xx',
+                endTime: 1516151355000,
+                operationName: '/user/tt',
+                'type|1': ['Local', 'Entry', 'Exit'],
+                'component|1': ['MySQL', 'H2', 'Spring'],
+                peer: '@ip',
+                'tags|1-5': [{ key: 'db.type', value: 'aa' }],
+                'logs|2-10': [{ 'time|+1': 1516151345000, 'data|3-8': [{ key: 
'db.type', value: 'aa' }] }],
+              },
+              {
+                spanId: 2,
+                parentSpanId: 1,
+                segmentId: 1,
+                applicationCode: 'yy',
+                startTime: 1516151348000,
+                endTime: 1516151351000,
+                operationName: '/sql/qq',
+                'type|1': ['Local', 'Entry', 'Exit'],
+                'component|1': ['MySQL', 'H2', 'Spring'],
+                peer: '@ip',
+                'tags|1-5': [{ key: 'db.type', value: 'aa' }],
+              },
+              {
+                spanId: 3,
+                parentSpanId: 2,
+                segmentId: 1,
+                applicationCode: 'yy',
+                startTime: 1516151349312,
+                endTime: 1516151350728,
+                operationName: '/sql/qq',
+                'type|1': ['Local', 'Entry', 'Exit'],
+                'component|1': ['MySQL', 'H2', 'Spring'],
+                peer: '@ip',
+                'tags|1-5': [{ key: 'db.type', value: 'aa' }],
+              },
+              {
+                spanId: 4,
+                parentSpanId: 1,
+                segmentId: 1,
+                applicationCode: 'zz',
+                startTime: 1516151351000,
+                endTime: 1516151354000,
+                operationName: '/sql/qq',
+                'type|1': ['Local', 'Entry', 'Exit'],
+                'component|1': ['MySQL', 'H2', 'Spring'],
+                peer: '@ip',
+                'tags|1-5': [{ key: 'db.type', value: 'aa' }],
+              },
+              {
+                spanId: 5,
+                parentSpanId: 1,
+                segmentId: 1,
+                applicationCode: 'zz',
+                startTime: 1516151351000,
+                endTime: 1516151354000,
+                operationName: '/mq/producer',
+                'type|1': ['Exit'],
+                'component|1': ['RockerMQ'],
+                peer: '@ip',
+                'tags|1-5': [{ key: 'producer', value: 'tt' }],
+              },
+              {
+                spanId: 6,
+                segmentId: 1,
+                applicationCode: 'kk',
+                startTime: 1516151355000,
+                endTime: 1516151360000,
+                operationName: '/mq/consumer',
+                'type|1': ['Entry'],
+                'component|1': ['RockerMQ'],
+                peer: '@ip',
+                'tags|1-5': [{ key: 'consumer', value: 'tt' }],
+                refs: [
+                  {
+                    parentSpanId: 5,
+                    parentSegmentId: 1,
+                  },
+                ],
+              },
+              {
+                spanId: 6,
+                segmentId: 1,
+                applicationCode: 'kk',
+                startTime: 1516151355000,
+                endTime: 1516151360000,
+                operationName: '/mq/consumer',
+                'type|1': ['Entry'],
+                'component|1': ['Kafka'],
+                peer: '@ip',
+                'tags|1-5': [{ key: 'consumer', value: 'tt' }],
+                refs: [
+                  {
+                    traceId: 121212,
+                    type: 'CROSS_PROCESS',
+                  },
+                  {
+                    traceId: 22223333,
+                    type: 'CROSS_THREAD',
+                  },
+                ],
+              },
+            ],
+          },
+        },
+      }
+    ));
+  },
+};

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

Reply via email to