Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Amend query
Browse files Browse the repository at this point in the history
  • Loading branch information
hanahmily committed Mar 1, 2018
1 parent 67c7fe9 commit 80dd15a
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .webpackrc.js
Expand Up @@ -17,7 +17,7 @@ const config = {
"template": "./src/index.ejs"
},
"publicPath": "/",
"disableDynamicImport": true,
"disableDynamicImport": false,
"hash": true
}

Expand Down
10 changes: 5 additions & 5 deletions mock/application.js
Expand Up @@ -51,39 +51,39 @@ export default {
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 1,
target: 201,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 1,
target: 202,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 1,
target: 203,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 1,
target: 204,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
],
});
Expand Down
6 changes: 2 additions & 4 deletions mock/service.js
Expand Up @@ -38,7 +38,6 @@ export default {
'type|1': ['DUBBO', 'USER', 'SPRINGMVC'],
'calls|1000-2000': 1,
'sla|1-100.1-2': 1,
'apdex|0.2': 1,
'numOfServiceAlarm|1-100': 1,
},
],
Expand All @@ -51,7 +50,6 @@ export default {
'type|1': ['DUBBO', 'tomcat', 'SPRINGMVC'],
'calls|1000-2000': 1,
'sla|1-100.1-2': 1,
'apdex|0.2': 1,
'numOfServiceAlarm|1-100': 1,
},
],
Expand All @@ -72,14 +70,14 @@ export default {
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|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,
'avgResponseTime|500-5000': 1,
}))));
return {
nodes,
Expand Down
16 changes: 8 additions & 8 deletions mock/topology.js
Expand Up @@ -15,7 +15,7 @@ export default {
'callsPerSec|1000-2000': 1,
'sla|1-100.1-2': 1,
'apdex|0.2': 1,
'responseTimePerSec|500-1000': 1,
'avgResponseTime|500-1000': 1,
'isAlarm|1': true,
'numOfServer|1-100': 1,
'numOfServerAlarm|1-100': 1,
Expand Down Expand Up @@ -50,55 +50,55 @@ export default {
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 1,
target: 2,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 1,
target: 200,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 1,
target: 201,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 2,
target: 202,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 2,
target: 203,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
{
source: 2,
target: 204,
'isAlarm|1': true,
'callType|1': ['rpc', 'http', 'dubbo'],
'callsPerSec|100-2000': 1,
'responseTimePerSec|500-5000': 1,
'avgResponseTime|500-5000': 1,
},
],
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/Topology/AppTopology.js
Expand Up @@ -43,7 +43,7 @@ export default class AppTopology extends Base {
'target-arrow-color': ele => (ele.data('isAlarm') ? 'red' : 'rgb(147, 198, 174)'),
'line-color': ele => (ele.data('isAlarm') ? 'red' : 'rgb(147, 198, 174)'),
width: 2,
label: ele => `${ele.data('callType')} \n ${ele.data('callsPerSec')} tps / ${ele.data('responseTimePerSec')} ms`,
label: ele => `${ele.data('callType')} \n ${ele.data('callsPerSec')} tps / ${ele.data('avgResponseTime')} ms`,
'text-wrap': 'wrap',
color: 'rgb(110, 112, 116)',
'text-rotation': 'autorotate',
Expand Down
4 changes: 2 additions & 2 deletions src/components/Topology/ServiceTopology.js
Expand Up @@ -43,7 +43,7 @@ export default class ServiceTopology extends Base {
'target-arrow-color': ele => (ele.data('isAlarm') ? 'red' : 'rgb(147, 198, 174)'),
'line-color': ele => (ele.data('isAlarm') ? 'red' : 'rgb(147, 198, 174)'),
width: 2,
label: ele => `${ele.data('callType')} \n ${ele.data('callsPerSec')} tps / ${ele.data('responseTimePerSec')} ms`,
label: ele => `${ele.data('callType')} \n ${ele.data('callsPerSec')} tps / ${ele.data('avgResponseTime')} ms`,
'text-wrap': 'wrap',
color: 'rgb(110, 112, 116)',
'text-rotation': 'autorotate',
Expand All @@ -63,7 +63,7 @@ export default class ServiceTopology extends Base {
tpl(data) {
return `
<div class="${styles.circle}">
<div class="node-percentage">${data.sla}%</div>
<div class="node-percentage">${data.sla / 100}%</div>
<div>${data.calls} calls/s</div>
<div>
<img src="alert.png" class="${styles.logo}"/>
Expand Down
4 changes: 2 additions & 2 deletions src/models/application.js
Expand Up @@ -29,7 +29,7 @@ const dataQuery = `
... on ApplicationNode {
sla
callsPerSec
responseTimePerSec
avgResponseTime
apdex
isAlarm
numOfServer
Expand All @@ -43,7 +43,7 @@ const dataQuery = `
isAlert
callType
callsPerSec
responseTimePerSec
avgResponseTime
}
}
}
Expand Down
11 changes: 3 additions & 8 deletions src/models/service.js
Expand Up @@ -16,14 +16,9 @@ const dataQuery = `
id
name
type
... on ApplicationNode {
... on ServiceNode {
sla
callsPerSec
responseTimePerSec
apdex
isAlarm
numOfServer
numOfServerAlarm
calls
numOfServiceAlarm
}
}
Expand All @@ -33,7 +28,7 @@ const dataQuery = `
isAlert
callType
callsPerSec
responseTimePerSec
avgResponseTime
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/models/topology.js
Expand Up @@ -18,7 +18,7 @@ export default generateModal({
... on ApplicationNode {
sla
callsPerSec
responseTimePerSec
avgResponseTime
apdex
isAlarm
numOfServer
Expand All @@ -32,7 +32,7 @@ export default generateModal({
isAlert
callType
callsPerSec
responseTimePerSec
avgResponseTime
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/models/trace.js
Expand Up @@ -27,7 +27,7 @@ const dataQuery = `

const spanQuery = `query Spans($traceId: ID!) {
queryTrace(traceId: $traceId) {
spnas {
spans {
traceId
segmentId
spanId
Expand Down
3 changes: 0 additions & 3 deletions src/routes/Trace/Trace.js
Expand Up @@ -47,9 +47,6 @@ export default class Trace extends PureComponent {
const filteredVariables = { ...variables };
filteredVariables.queryDuration = filteredVariables.duration;
delete filteredVariables.duration;
if (filteredVariables.applicationId && !Array.isArray(filteredVariables.applicationId)) {
filteredVariables.applicationId = [filteredVariables.applicationId];
}
this.props.dispatch({
type: 'trace/fetchData',
payload: { variables: { condition: filteredVariables } },
Expand Down

0 comments on commit 80dd15a

Please sign in to comment.