This is an automated email from the ASF dual-hosted git repository. hanahmily pushed a commit to branch feature/5.0.0 in repository https://gitbox.apache.org/repos/asf/incubator-skywalking-ui.git
The following commit(s) were added to refs/heads/feature/5.0.0 by this push: new 5e6cb04 Overhaul query for integration test new 42b2f3e Merge branch 'feature/5.0.0' of https://github.com/apache/incubator-skywalking-ui into feature/5.0.0 5e6cb04 is described below commit 5e6cb0418828779425e30dafbea26ecf3dabd115 Author: hanahmily <hanahm...@gmail.com> AuthorDate: Fri Feb 9 14:22:02 2018 +0800 Overhaul query for integration test --- src/main/frontend/.gitignore | 1 + src/main/frontend/jsconfig.json | 5 +++ .../frontend/src/components/Page/Search/index.js | 4 +- src/main/frontend/src/models/application.js | 20 ++++----- src/main/frontend/src/models/trace.js | 50 ++++++++++++++++++++-- src/main/frontend/src/routes/Service/Service.js | 10 +---- src/main/frontend/src/routes/Trace/Trace.js | 19 +++++--- 7 files changed, 80 insertions(+), 29 deletions(-) diff --git a/src/main/frontend/.gitignore b/src/main/frontend/.gitignore index 2af4ed6..b2d4086 100755 --- a/src/main/frontend/.gitignore +++ b/src/main/frontend/.gitignore @@ -14,3 +14,4 @@ npm-debug.log* /coverage /node +.vscode diff --git a/src/main/frontend/jsconfig.json b/src/main/frontend/jsconfig.json new file mode 100644 index 0000000..418ea96 --- /dev/null +++ b/src/main/frontend/jsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "experimentalDecorators": true + } + } \ No newline at end of file diff --git a/src/main/frontend/src/components/Page/Search/index.js b/src/main/frontend/src/components/Page/Search/index.js index 199647a..93ab084 100644 --- a/src/main/frontend/src/components/Page/Search/index.js +++ b/src/main/frontend/src/components/Page/Search/index.js @@ -19,7 +19,7 @@ export default class Search extends PureComponent { if (!value || value.length < 1) { return; } - const { url, query, variables: { duration } } = this.props; + const { url, query, variables = {} } = this.props; this.lastFetchId += 1; const fetchId = this.lastFetchId; this.setState({ data: [], fetching: true }); @@ -27,8 +27,8 @@ export default class Search extends PureComponent { method: 'POST', body: { variables: { + ...variables, keyword: value, - duration, }, query, }, diff --git a/src/main/frontend/src/models/application.js b/src/main/frontend/src/models/application.js index 03cc45a..c2ce69d 100644 --- a/src/main/frontend/src/models/application.js +++ b/src/main/frontend/src/models/application.js @@ -11,16 +11,16 @@ const optionsQuery = ` const dataQuery = ` query Application($applicationId: ID!, $duration: Duration!) { - # getSlowService(applicationId: $applicationId, duration: $duration, top: 10) { - # key: id - # name - # avgResponseTime - # } - # getServerThroughput(applicationId: $applicationId, duration: $duration, top: 10) { - # key: id - # name - # tps - # } + getSlowService(applicationId: $applicationId, duration: $duration, top: 10) { + key: id + name + avgResponseTime + } + getServerThroughput(applicationId: $applicationId, duration: $duration, top: 10) { + key: id + name + tps + } getApplicationTopology(applicationId: $applicationId, duration: $duration) { nodes { id diff --git a/src/main/frontend/src/models/trace.js b/src/main/frontend/src/models/trace.js index 3e1760a..ab5ee17 100644 --- a/src/main/frontend/src/models/trace.js +++ b/src/main/frontend/src/models/trace.js @@ -11,13 +11,55 @@ const optionsQuery = ` `; const dataQuery = ` - query BasicTraces($condition: TraceQueryCondition){ - queryBasicTraces(condition: $condition) + query BasicTraces($condition: TraceQueryCondition) { + queryBasicTraces(condition: $condition) { + traces { + operationName + duration + start + isError + traceId + } + total + } } `; -const spanQuery = `query Spans($traceId: ID!){ - queryTrace(traceId: $traceId) +const spanQuery = `query Spans($traceId: ID!) { + queryTrace(traceId: $traceId) { + spnas { + traceId + segmentId + spanId + parentSpanId + refs { + traceId + parentSegmentId + parentSpanId + type + } + applicationCode + startTime + endTime + operationName + type + peer + component + isError + layer + tags { + key + value + } + logs { + time + data { + key + value + } + } + } + } }`; export default generateModal({ diff --git a/src/main/frontend/src/routes/Service/Service.js b/src/main/frontend/src/routes/Service/Service.js index c38eb75..febe3d0 100644 --- a/src/main/frontend/src/routes/Service/Service.js +++ b/src/main/frontend/src/routes/Service/Service.js @@ -63,17 +63,11 @@ export default class Service extends PureComponent { placeholder="Search a service" onSelect={this.handleSelect.bind(this)} url="/service/search" - variables={{ duration: this.props.globalVariables.duration }} query={` - query SearchService($keyword: String!, $duration: Duration!) { - searchService(keyword: $keyword, duration: $duration) { + query SearchService($keyword: String!) { + searchService(keyword: $keyword, topN: 10) { key: id label: name - type - calls - sla - apdex - numOfServiceAlarm } } `} diff --git a/src/main/frontend/src/routes/Trace/Trace.js b/src/main/frontend/src/routes/Trace/Trace.js index f4e8670..0730ed9 100644 --- a/src/main/frontend/src/routes/Trace/Trace.js +++ b/src/main/frontend/src/routes/Trace/Trace.js @@ -34,12 +34,21 @@ export default class Trace extends PureComponent { payload: { variables: this.props.globalVariables }, }); } + componentWillUpdate(nextProps) { + if (nextProps.globalVariables.duration === this.props.globalVariables.duration) { + return; + } + this.props.dispatch({ + type: 'trace/initOptions', + payload: { variables: nextProps.globalVariables }, + }); + } handleChange = (variables) => { const filteredVariables = { ...variables }; filteredVariables.queryDuration = filteredVariables.duration; delete filteredVariables.duration; - if (filteredVariables.applicationCodes && !Array.isArray(filteredVariables.applicationCodes)) { - filteredVariables.applicationCodes = [filteredVariables.applicationCodes]; + if (filteredVariables.applicationId && !Array.isArray(filteredVariables.applicationId)) { + filteredVariables.applicationId = [filteredVariables.applicationId]; } this.props.dispatch({ type: 'trace/fetchData', @@ -105,9 +114,9 @@ export default class Trace extends PureComponent { <Row gutter={{ md: 8, lg: 8, xl: 8 }}> <Col xl={4} sm={24}> <FormItem label="Application"> - {getFieldDecorator('applicationCodes')( - <Select mode="multiple" placeholder="Select application" style={{ width: '100%' }}> - {options.applicationCodes && options.applicationCodes.map((app) => { + {getFieldDecorator('applicationId')( + <Select placeholder="No application" style={{ width: '100%' }}> + {options.applicationId && options.applicationId.map((app) => { return (<Option value={app.key}>{app.label}</Option>); })} </Select> -- To stop receiving notification emails like this one, please contact hanahm...@apache.org.