Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new scenarios #6

Merged
merged 2 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions shadingsphere-benchmark-ui/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ export const constantRouterMap = [
component: () =>
import('@/views/sharding-proxy-single-database-single-table/index'),
hidden: true
},
{
path: '/shardingjdbc-vs-shardingproxy-encrypt',
component: () =>
import('@/views/shardingjdbc-vs-shardingproxy-encrypt/index'),
hidden: true
},
{
path: '/shardingjdbc-vs-shardingproxy-sharding-encrypt',
component: () =>
import('@/views/shardingjdbc-vs-shardingproxy-sharding-encrypt/index'),
hidden: true
}
]

Expand Down
2 changes: 1 addition & 1 deletion shadingsphere-benchmark-ui/src/utils/api.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import $ from 'jquery'

const HOST =
'https://raw.githubusercontent.com/wqzwh/incubator-shardingsphere-benchmark/master/report'
'https://raw.githubusercontent.com/apache/incubator-shardingsphere-benchmark/master/report/'

function ajax(url, type) {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion shadingsphere-benchmark-ui/src/utils/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const mountedMixin = {
legend[m].push(mm.type)
const data = []
for (const mmm of Object.keys(mm.data)) {
if (xAxis[m].length !== mm.data.length) {
if (xAxis[m].length < mm.data.length) {
xAxis[m].push(mmm)
}
data.push({
Expand Down
6 changes: 5 additions & 1 deletion shadingsphere-benchmark-ui/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ export default {
getShardingProxyMasterSlaveData: () =>
API.get(`/data_json/sharding_proxy_master_slave.json`),
getShardingProxySingleDatabaseSingleTableData: () =>
API.get(`/data_json/sharding_proxy_single_database_single_table.json`)
API.get(`/data_json/sharding_proxy_single_database_single_table.json`),
getShardingjdbcVsShardingproxyEncrypt: () =>
API.get(`/data_json/shardingjdbc_vs_shardingproxy_encrypt.json`),
getShardingjdbcVsShardingproxyShardingEncrypt: () =>
API.get(`/data_json/shardingjdbc_vs_shardingproxy_sharding_encrypt.json`)
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { mountedMixin } from '../../utils/mixin'
import { getLineOptions } from '../../utils/line'

export default {
name: 'Home',
name: 'MysqlVsSharding',
components: {
'v-chart': ECharts
},
Expand Down
17 changes: 17 additions & 0 deletions shadingsphere-benchmark-ui/src/views/overview/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@
</router-link>
</Card>
</Col>
<Col span="6">
<Card class="card-item">
<router-link to="shardingjdbc-vs-shardingproxy-encrypt">
<h3>shardingjdbc vs shardingproxy encrypt</h3>
<span class="card-span">detail</span>
</router-link>
</Card>
</Col>
<Col span="6">
<Card class="card-item">
<router-link to="shardingjdbc-vs-shardingproxy-sharding-encrypt">
<h3>shardingjdbc vs shardingproxy sharding encrypt</h3>
<span class="card-span">detail</span>
</router-link>
</Card>
</Col>
</Row>
</Card>
</template>
Expand All @@ -52,6 +68,7 @@ export default {
.card-item {
min-height: 150px;
position: relative;
margin-bottom: 15px;
}
h3 {
color: #333;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { mountedMixin } from '../../utils/mixin'
import { getLineOptions } from '../../utils/line'

export default {
name: 'Home',
name: 'ShardingProxyMasterSlaveSharding',
components: {
'v-chart': ECharts
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { mountedMixin } from '../../utils/mixin'
import { getLineOptions } from '../../utils/line'

export default {
name: 'Home',
name: 'ShardingProxyMasterSlave',
components: {
'v-chart': ECharts
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { mountedMixin } from '../../utils/mixin'
import { getLineOptions } from '../../utils/line'

export default {
name: 'Home',
name: 'ShardingProxySingleDatabaseSingleTable',
components: {
'v-chart': ECharts
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<template>
<Row :gutter="16" style="background:#eee; padding:20px">
<Col
v-for="(value, name, index) in series"
:key="index"
:xs="24"
:sm="24"
:md="24"
:lg="24"
:xl="24"
:xxl="12"
class="col-item"
>
<Card :bordered="false">
<p slot="title" style="font-size: 18px">{{ name.toLowerCase() }}</p>
<v-chart :options="getOptions(name)" />
<Form :label-width="140">
<FormItem
v-for="(value, name,indx) in desc[name]"
:label="`${name}:`"
:key="indx"
>{{ value }}</FormItem>
</Form>
</Card>
</Col>
<div v-show="loading" class="spin-container">
<Spin fix>
<Icon type="ios-loading" size="18" class="spin-icon-load" />
<div>Loading</div>
</Spin>
</div>
</Row>
</template>

<script>
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/title'
import apis from '../../utils/utils'
import { mountedMixin } from '../../utils/mixin'
import { getLineOptions } from '../../utils/line'

export default {
name: 'ShardingjdbcVsShardingproxyEncrypt',
components: {
'v-chart': ECharts
},
mixins: [mountedMixin],
data() {
return {
data: []
}
},
mounted() {
this.loading = true
apis.getShardingjdbcVsShardingproxyEncrypt().then(res => {
this.formatData(res)
this.loading = false
})
},
methods: {
getOptions(name) {
return getLineOptions(name, this.xAxis, this.legend, this.series)
}
}
}
</script>
<style>
.echarts {
width: 100%;
height: 400px;
}
.col-item {
margin-bottom: 16px;
}
.ivu-form-item {
margin-bottom: 10px !important;
}
.ivu-form-item-label {
font-size: 15px !important;
}
.ivu-form-item-content {
font-size: 14px !important;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<template>
<Row :gutter="16" style="background:#eee; padding:20px">
<Col
v-for="(value, name, index) in series"
:key="index"
:xs="24"
:sm="24"
:md="24"
:lg="24"
:xl="24"
:xxl="12"
class="col-item"
>
<Card :bordered="false">
<p slot="title" style="font-size: 18px">{{ name.toLowerCase() }}</p>
<v-chart :options="getOptions(name)" />
<Form :label-width="140">
<FormItem
v-for="(value, name,indx) in desc[name]"
:label="`${name}:`"
:key="indx"
>{{ value }}</FormItem>
</Form>
</Card>
</Col>
<div v-show="loading" class="spin-container">
<Spin fix>
<Icon type="ios-loading" size="18" class="spin-icon-load" />
<div>Loading</div>
</Spin>
</div>
</Row>
</template>

<script>
import ECharts from 'vue-echarts'
import 'echarts/lib/chart/line'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/title'
import apis from '../../utils/utils'
import { mountedMixin } from '../../utils/mixin'
import { getLineOptions } from '../../utils/line'

export default {
name: 'ShardingjdbcVsShardingproxyShardingEncrypt',
components: {
'v-chart': ECharts
},
mixins: [mountedMixin],
data() {
return {
data: []
}
},
mounted() {
this.loading = true
apis.getShardingjdbcVsShardingproxyShardingEncrypt().then(res => {
this.formatData(res)
this.loading = false
})
},
methods: {
getOptions(name) {
return getLineOptions(name, this.xAxis, this.legend, this.series)
}
}
}
</script>
<style>
.echarts {
width: 100%;
height: 400px;
}
.col-item {
margin-bottom: 16px;
}
.ivu-form-item {
margin-bottom: 10px !important;
}
.ivu-form-item-label {
font-size: 15px !important;
}
.ivu-form-item-content {
font-size: 14px !important;
}
</style>