|
|
@ -1,252 +1,154 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="dashboard-editor-container">
|
|
|
|
<div class="monitor-wrapper">
|
|
|
|
<div class="filter-container">
|
|
|
|
<div class="info-wrapper">
|
|
|
|
<el-select
|
|
|
|
<div class="top-card">
|
|
|
|
v-model="listQuery.itemId"
|
|
|
|
<svg-icon id="top-icon" icon-class="monitor" />
|
|
|
|
:placeholder="$t('projectManage.itemRequired')"
|
|
|
|
<div class="top-info">
|
|
|
|
style="width: 220px"
|
|
|
|
<div class="label">操作者:</div>
|
|
|
|
filterable
|
|
|
|
<span class="user">{{userName}}</span>
|
|
|
|
class="filter-item"
|
|
|
|
</div>
|
|
|
|
@change="itemSelectList()"
|
|
|
|
</div>
|
|
|
|
>
|
|
|
|
<div class="query-monitoring">
|
|
|
|
<el-option
|
|
|
|
<div class="title">查询监控</div>
|
|
|
|
v-for="item in itemOptions"
|
|
|
|
<el-cascader
|
|
|
|
:key="item.key"
|
|
|
|
class="el-cascader"
|
|
|
|
:label="item.display_name"
|
|
|
|
learable
|
|
|
|
:value="item.key"
|
|
|
|
v-model="selectMonitorValue"
|
|
|
|
/>
|
|
|
|
:options="selectMonitor"
|
|
|
|
</el-select>
|
|
|
|
:props="{ expandTrigger: 'hover' }"
|
|
|
|
<el-select
|
|
|
|
@change="handleChangeMonitorSelect"></el-cascader>
|
|
|
|
v-model="listQuery.tpId"
|
|
|
|
</div>
|
|
|
|
:placeholder="$t('threadPool.threadPoolRequired')"
|
|
|
|
<div class="info-card">
|
|
|
|
style="width: 220px"
|
|
|
|
<div class="info-card-title">{{ selectMonitor[0].label }}数量</div>
|
|
|
|
filterable
|
|
|
|
<div class="data-num">
|
|
|
|
class="filter-item"
|
|
|
|
<span class="num">
|
|
|
|
@change="threadPoolSelectList()"
|
|
|
|
{{ selectMonitor[0].children.length || "_" }}
|
|
|
|
>
|
|
|
|
</span>个
|
|
|
|
<el-option
|
|
|
|
</div>
|
|
|
|
v-for="item in threadPoolOptions"
|
|
|
|
</div>
|
|
|
|
:key="item.key"
|
|
|
|
<div class="tp-card">
|
|
|
|
:label="item.display_name"
|
|
|
|
<div class="tp-item" v-for="(item, index) in tableData" :key="index">
|
|
|
|
:value="item.key"
|
|
|
|
<div>{{ item.name }}</div>
|
|
|
|
/>
|
|
|
|
<div class="tp-label">{{ item.label }}</div>
|
|
|
|
</el-select>
|
|
|
|
</div>
|
|
|
|
<el-select
|
|
|
|
</div>
|
|
|
|
v-model="listQuery.identify"
|
|
|
|
</div>
|
|
|
|
:placeholder="$t('threadPoolMonitor.ipPortRequired')"
|
|
|
|
<div class="search-wrapper">
|
|
|
|
style="width: 220px"
|
|
|
|
<div class="demonstration">时间筛选</div>
|
|
|
|
filterable
|
|
|
|
<el-date-picker
|
|
|
|
class="filter-item"
|
|
|
|
type="datetimerange"
|
|
|
|
>
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
<el-option
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
v-for="item in identifyOptions"
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
:key="item.key"
|
|
|
|
v-model="timeValue"
|
|
|
|
:label="item.display_name"
|
|
|
|
@input="changeMonitorData">
|
|
|
|
:value="item.key"
|
|
|
|
</el-date-picker>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</el-select>
|
|
|
|
<div class="center-chart-wrapper">
|
|
|
|
|
|
|
|
<line-chart title="任务数" :chart-data="lineChartData" :times="times" height="100%" :cus-formatter="true" />
|
|
|
|
<el-button
|
|
|
|
</div>
|
|
|
|
v-waves
|
|
|
|
<div class="bottom-chart-wraper">
|
|
|
|
class="filter-item"
|
|
|
|
<div class="inner-chart">
|
|
|
|
type="primary"
|
|
|
|
<line-chart title="活跃线程数" :chart-data="activeSizeList" :times="times" height="100%" />
|
|
|
|
style="margin-left: 10px"
|
|
|
|
</div>
|
|
|
|
icon="el-icon-search"
|
|
|
|
<div class="inner-chart">
|
|
|
|
@click="fetchData"
|
|
|
|
<line-chart title="线程数" :chart-data="poolSizeList" :times="times" height="100%" />
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
{{ $t('common.query') }}
|
|
|
|
<div class="inner-chart">
|
|
|
|
</el-button>
|
|
|
|
<line-chart title="队列元素数" :chart-data="queueSizeList" :times="times" height="100%" />
|
|
|
|
<el-button
|
|
|
|
</div>
|
|
|
|
v-waves
|
|
|
|
<div class="inner-chart">
|
|
|
|
class="filter-item"
|
|
|
|
<line-chart title="拒绝数" :chart-data="rangeRejectCountList" :times="times" height="100%" />
|
|
|
|
type="primary"
|
|
|
|
</div>
|
|
|
|
style="margin-left: 10px"
|
|
|
|
|
|
|
|
icon="el-icon-refresh"
|
|
|
|
|
|
|
|
@click="refreshData"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ $t('common.reset') }}
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-empty v-if="!temp.coreSize" :description="$t('threadPoolMonitor.noResultsYet')" />
|
|
|
|
|
|
|
|
<section v-else>
|
|
|
|
|
|
|
|
<!-- <el-card shadow="hover">
|
|
|
|
|
|
|
|
<el-descriptions :column="3" border>
|
|
|
|
|
|
|
|
<el-descriptions-item label="实例 ID">{{ listQuery.identify }}</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-descriptions-item label="核心线程">{{ temp.coreSize }}</el-descriptions-item>
|
|
|
|
|
|
|
|
<el-descriptions-item label="最大线程">{{ temp.maxSize }}</el-descriptions-item>
|
|
|
|
|
|
|
|
<el-descriptions-item label="队列类型">
|
|
|
|
|
|
|
|
{{ temp.queueType | queueFilter }}
|
|
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
|
<el-descriptions-item label="队列容量">{{ temp.capacity }}</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-descriptions-item label="已完成任务数">{{ lastTaskCount }}</el-descriptions-item>
|
|
|
|
|
|
|
|
<el-descriptions-item label="拒绝策略">
|
|
|
|
|
|
|
|
{{ temp.rejectedType | rejectedFilter }}
|
|
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-descriptions-item label="是否报警">
|
|
|
|
|
|
|
|
{{ temp.isAlarm | alarmFilter }}
|
|
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
|
<el-descriptions-item label="任务拒绝次数">
|
|
|
|
|
|
|
|
{{ rejectCount }}
|
|
|
|
|
|
|
|
</el-descriptions-item>
|
|
|
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
</el-card> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" style="margin-top: 16px">
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
|
|
|
<line-chart :chart-data="lineChartData1" :times="times" />
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<!-- <el-col :span="8">
|
|
|
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
|
|
|
<line-chart :chart-data="lineChartData2" :times="times" />
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
|
|
|
<line-chart :chart-data="lineChartData3" :times="times" />
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row :gutter="10" style="margin-top: 16px">
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
|
|
|
<line-chart :chart-data="lineChartData5" :times="times" />
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<!-- <el-col :span="8">
|
|
|
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
|
|
|
<line-chart :chart-data="lineChartData4" :times="times" />
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col> -->
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-card shadow="hover">
|
|
|
|
|
|
|
|
<line-chart :chart-data="lineChartData6" :times="times" />
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import LineChart from './components/LineChart.vue';
|
|
|
|
|
|
|
|
import waves from '@/directive/waves';
|
|
|
|
|
|
|
|
import * as itemApi from '@/api/hippo4j-item';
|
|
|
|
|
|
|
|
import * as tenantApi from '@/api/hippo4j-tenant';
|
|
|
|
|
|
|
|
import * as threadPoolApi from '@/api/hippo4j-threadPool';
|
|
|
|
import * as threadPoolApi from '@/api/hippo4j-threadPool';
|
|
|
|
import * as instanceApi from '@/api/hippo4j-instance';
|
|
|
|
|
|
|
|
import * as monitorApi from '@/api/hippo4j-monitor';
|
|
|
|
import * as monitorApi from '@/api/hippo4j-monitor';
|
|
|
|
|
|
|
|
import * as instanceApi from '@/api/hippo4j-instance';
|
|
|
|
|
|
|
|
import * as itemApi from '@/api/hippo4j-item';
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import { mapGetters } from 'vuex';
|
|
|
|
import { i18nConfig } from '@/locale/config'
|
|
|
|
import { i18nConfig } from '@/locale/config'
|
|
|
|
|
|
|
|
import LineChart from './components/LineChart.vue';
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'Monitor',
|
|
|
|
name: 'Monitor',
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
LineChart,
|
|
|
|
LineChart,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
directives: { waves },
|
|
|
|
|
|
|
|
filters: {
|
|
|
|
|
|
|
|
queueFilter(type) {
|
|
|
|
|
|
|
|
const typeList = {
|
|
|
|
|
|
|
|
1: 'ArrayBlockingQueue',
|
|
|
|
|
|
|
|
2: 'LinkedBlockingQueue',
|
|
|
|
|
|
|
|
3: 'LinkedBlockingDeque',
|
|
|
|
|
|
|
|
4: 'SynchronousQueue',
|
|
|
|
|
|
|
|
5: 'LinkedTransferQueue',
|
|
|
|
|
|
|
|
6: 'PriorityBlockingQueue',
|
|
|
|
|
|
|
|
9: 'ResizableLinkedBlockingQueue',
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
return typeList[type];
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rejectedFilter(type) {
|
|
|
|
|
|
|
|
const typeList = {
|
|
|
|
|
|
|
|
1: 'CallerRunsPolicy',
|
|
|
|
|
|
|
|
2: 'AbortPolicy',
|
|
|
|
|
|
|
|
3: 'DiscardPolicy',
|
|
|
|
|
|
|
|
4: 'DiscardOldestPolicy',
|
|
|
|
|
|
|
|
5: 'RunsOldestTaskPolicy',
|
|
|
|
|
|
|
|
6: 'SyncPutQueuePolicy',
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
return type && typeList[type] ? typeList[type] : type ? `CustomRejectedPolicy-${type}` : '';
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
alarmFilter(type) {
|
|
|
|
|
|
|
|
return type === '1' ? '报警' : '忽略';
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
allowCoreThreadTimeOutFilter(type) {
|
|
|
|
|
|
|
|
return type === '1' ? '超时' : '不超时';
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
lineChartData1: [
|
|
|
|
lineChartData: [],
|
|
|
|
{
|
|
|
|
times: [],
|
|
|
|
name: 'activeSizeList',
|
|
|
|
timeValue: new Date(),
|
|
|
|
data: [],
|
|
|
|
selectMonitorValue: {
|
|
|
|
color: '#709775',
|
|
|
|
default: [0]
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
lineChartData2: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'poolSizeList',
|
|
|
|
|
|
|
|
data: [],
|
|
|
|
|
|
|
|
color: '#e9c46a',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
lineChartData3: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'queueSizeList',
|
|
|
|
|
|
|
|
data: [],
|
|
|
|
|
|
|
|
color: '#003049',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
lineChartData4: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'queueRemainingCapacityList',
|
|
|
|
|
|
|
|
data: [],
|
|
|
|
|
|
|
|
color: '#f4a261',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
lineChartData5: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
name: 'completedTaskCountList',
|
|
|
|
|
|
|
|
data: [],
|
|
|
|
|
|
|
|
color: '#023e8a',
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
selectMonitor: [{
|
|
|
|
lineChartData6: [
|
|
|
|
value: 0,
|
|
|
|
{
|
|
|
|
label: '项目',
|
|
|
|
name: 'rejectCountList',
|
|
|
|
children: []
|
|
|
|
data: [],
|
|
|
|
}, {
|
|
|
|
color: '#dd1c1a',
|
|
|
|
value: 1,
|
|
|
|
|
|
|
|
label: '线程池',
|
|
|
|
|
|
|
|
children: [],
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
value: 2,
|
|
|
|
|
|
|
|
label: '实例',
|
|
|
|
|
|
|
|
children: [],
|
|
|
|
|
|
|
|
}],
|
|
|
|
|
|
|
|
activeSizeList: [],
|
|
|
|
|
|
|
|
poolSizeList: [],
|
|
|
|
|
|
|
|
queueSizeList: [],
|
|
|
|
|
|
|
|
rangeRejectCountList: [],
|
|
|
|
|
|
|
|
chooseData: {},
|
|
|
|
|
|
|
|
pickerOptions: {
|
|
|
|
|
|
|
|
shortcuts: [{
|
|
|
|
|
|
|
|
text: '今天',
|
|
|
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
|
|
|
picker.$emit('pick', new Date());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
text: '昨天',
|
|
|
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
|
|
|
const date = new Date();
|
|
|
|
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24);
|
|
|
|
|
|
|
|
picker.$emit('pick', date);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
text: '一周前',
|
|
|
|
|
|
|
|
onClick(picker) {
|
|
|
|
|
|
|
|
const date = new Date();
|
|
|
|
|
|
|
|
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
|
|
|
|
picker.$emit('pick', date);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
selectMonitor: [],
|
|
|
|
times: [],
|
|
|
|
tableData: [{
|
|
|
|
size: 500,
|
|
|
|
date: '2016-05-02',
|
|
|
|
tenantOptions: [],
|
|
|
|
name: '王小虎',
|
|
|
|
threadPoolOptions: [],
|
|
|
|
}, {
|
|
|
|
itemOptions: [],
|
|
|
|
date: '2016-05-04',
|
|
|
|
identifyOptions: [],
|
|
|
|
name: '王小虎',
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
date: '2016-05-01',
|
|
|
|
|
|
|
|
name: '王小虎',
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
date: '2016-05-03',
|
|
|
|
|
|
|
|
name: '王小虎',
|
|
|
|
|
|
|
|
}],
|
|
|
|
listQuery : {
|
|
|
|
listQuery : {
|
|
|
|
current: 1,
|
|
|
|
"current": 1,
|
|
|
|
size: 10,
|
|
|
|
"size": 10,
|
|
|
|
itemId: '',
|
|
|
|
"itemId": "dynamic-threadpool-example",
|
|
|
|
tpId: '',
|
|
|
|
"tpId": "message-produce",
|
|
|
|
tenantId: '',
|
|
|
|
"tenantId": "prescription",
|
|
|
|
identify: '',
|
|
|
|
"identify": "127.0.0.1:8088_93bfe5307a844e07ada13cbfc3f16662",
|
|
|
|
instanceId: '',
|
|
|
|
"instanceId": "127.0.0.1:8088_93bfe5307a844e07ada13cbfc3f16662"
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
temp: {},
|
|
|
|
|
|
|
|
rejectCount: null,
|
|
|
|
|
|
|
|
lastTaskCount: null,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
...mapGetters([
|
|
|
|
...mapGetters([
|
|
|
@ -259,153 +161,315 @@ export default {
|
|
|
|
this.fetchData()
|
|
|
|
this.fetchData()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async created() {
|
|
|
|
created() {
|
|
|
|
this.initSelect();
|
|
|
|
this.fetchData()
|
|
|
|
|
|
|
|
this.fetchChartData()
|
|
|
|
|
|
|
|
this.getSelectMonitor()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
fetchData() {
|
|
|
|
fetchData() {
|
|
|
|
|
|
|
|
this.userName = this.$cookie.get('userName')
|
|
|
|
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
|
|
|
|
this.listQuery.tenantId = this?.tenantInfo?.tenantId || this.listQuery.tenantId
|
|
|
|
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
|
|
|
|
let isAllTenant = this.listQuery.tenantId == i18nConfig.messages.zh.common.allTenant || this.listQuery.tenantId == i18nConfig.messages.en.common.allTenant
|
|
|
|
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
|
|
|
|
this.listQuery.tenantId = isAllTenant ? '' : this.listQuery.tenantId
|
|
|
|
if (!this.listQuery.tenantId) {
|
|
|
|
|
|
|
|
this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('tenantManage.tenant') }));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.listQuery.itemId) {
|
|
|
|
|
|
|
|
this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('projectManage.item') }));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.listQuery.tpId) {
|
|
|
|
|
|
|
|
this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('threadPool.threadPool') }));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.listQuery.identify) {
|
|
|
|
|
|
|
|
this.$message.warning(this.$t('message.emptyWarning', { name: this.$t('threadPoolMonitor.ipPort') }));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.listQuery.instanceId = this.listQuery.identify;
|
|
|
|
|
|
|
|
threadPoolApi.info( this.listQuery).then((res) => {
|
|
|
|
threadPoolApi.info( this.listQuery).then((res) => {
|
|
|
|
this.temp = res;
|
|
|
|
this.temp = res;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// monitorApi.lastTaskCountFun(this.listQuery).then((res) => {
|
|
|
|
|
|
|
|
// this.rejectCount = res.rejectCount;
|
|
|
|
|
|
|
|
// this.lastTaskCount = res.completedTaskCount;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.initChart();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
refreshData() {
|
|
|
|
|
|
|
|
this.listQuery.tenantId = null;
|
|
|
|
|
|
|
|
this.listQuery.itemId = null;
|
|
|
|
|
|
|
|
this.listQuery.tpId = null;
|
|
|
|
|
|
|
|
this.listQuery.identify = null;
|
|
|
|
|
|
|
|
this.itemOptions = [];
|
|
|
|
|
|
|
|
this.threadPoolOptions = [];
|
|
|
|
|
|
|
|
this.identifyOptions = [];
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
initSelect() {
|
|
|
|
getSelectMonitor() {
|
|
|
|
tenantApi.list({ size: this.size }).then((res) => {
|
|
|
|
this.selectMonitor = [{
|
|
|
|
|
|
|
|
value: 0,
|
|
|
|
|
|
|
|
label: '项目',
|
|
|
|
|
|
|
|
children: []
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
value: 1,
|
|
|
|
|
|
|
|
label: '线程池',
|
|
|
|
|
|
|
|
children: [],
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
value: 2,
|
|
|
|
|
|
|
|
label: '实例',
|
|
|
|
|
|
|
|
children: [],
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
//项目接口 itenId
|
|
|
|
|
|
|
|
itemApi.list(this.listQuery).then((res) => {
|
|
|
|
const { records } = res || {};
|
|
|
|
const { records } = res || {};
|
|
|
|
this.tenantOptions =
|
|
|
|
records && records.map((item) => {
|
|
|
|
records &&
|
|
|
|
item.value = item.tenantId
|
|
|
|
records.map((item) => {
|
|
|
|
item.label = item.tenantId
|
|
|
|
return {
|
|
|
|
|
|
|
|
key: item.tenantId,
|
|
|
|
|
|
|
|
display_name: item.tenantId + ' ' + item.tenantName,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.selectMonitor[0].children = records
|
|
|
|
|
|
|
|
//初始化tenantId
|
|
|
|
|
|
|
|
this.selectMonitorValue = [0, records[0].tenantId ]
|
|
|
|
|
|
|
|
this.listQuery.tenantId = records[0].tenantId
|
|
|
|
|
|
|
|
this.listQuery.itemId = records[0].itemId
|
|
|
|
|
|
|
|
this.listQuery.current = records[0].current
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
//线程池接口tpId,itemId,tenantId
|
|
|
|
|
|
|
|
threadPoolApi.list( this.listQuery).then((res) => {
|
|
|
|
tenantSelectList() {
|
|
|
|
|
|
|
|
this.listQuery.itemId = null;
|
|
|
|
|
|
|
|
this.listQuery.tpId = null;
|
|
|
|
|
|
|
|
this.listQuery.identify = null;
|
|
|
|
|
|
|
|
this.itemOptions = [];
|
|
|
|
|
|
|
|
this.threadPoolOptions = [];
|
|
|
|
|
|
|
|
this.identifyOptions = [];
|
|
|
|
|
|
|
|
const params = { tenantId: this.listQuery.tenantId, size: this.size };
|
|
|
|
|
|
|
|
itemApi.list(params).then((res) => {
|
|
|
|
|
|
|
|
const { records } = res || {};
|
|
|
|
const { records } = res || {};
|
|
|
|
this.itemOptions =
|
|
|
|
records && records.map((item) => {
|
|
|
|
records &&
|
|
|
|
item.value = item.tenantId
|
|
|
|
records.map((item) => {
|
|
|
|
item.label = item.tenantId
|
|
|
|
return {
|
|
|
|
|
|
|
|
key: item.itemId,
|
|
|
|
|
|
|
|
display_name: item.itemId + ' ' + item.itemName,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.selectMonitor[1].children = records
|
|
|
|
|
|
|
|
this.listQuery.tenantId = records[0].tenantId
|
|
|
|
|
|
|
|
this.listQuery.itemId = records[0].itemId
|
|
|
|
|
|
|
|
this.listQuery.current = records[0].current
|
|
|
|
|
|
|
|
this.listQuery.tpId = records[0].tpId
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
let param = [
|
|
|
|
|
|
|
|
this.listQuery.itemId,
|
|
|
|
itemSelectList() {
|
|
|
|
this.listQuery.tpId,
|
|
|
|
this.listQuery.tpId = null;
|
|
|
|
]
|
|
|
|
this.listQuery.identify = null;
|
|
|
|
//实例接口
|
|
|
|
this.threadPoolOptions = [];
|
|
|
|
instanceApi.list(param).then((res) => {
|
|
|
|
this.identifyOptions = [];
|
|
|
|
res.map((item) => {
|
|
|
|
const params = { itemId: this.listQuery.itemId, size: this.size };
|
|
|
|
item.value = item.tenantId
|
|
|
|
threadPoolApi.list(params).then((res) => {
|
|
|
|
item.label = item.tenantId
|
|
|
|
const { records } = res || {};
|
|
|
|
|
|
|
|
this.threadPoolOptions =
|
|
|
|
|
|
|
|
records &&
|
|
|
|
|
|
|
|
records.map((item) => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
key: item.tpId,
|
|
|
|
|
|
|
|
display_name: item.tpId,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.selectMonitor[2].children = res
|
|
|
|
|
|
|
|
this.listQuery.tenantId = res[0].tenantId
|
|
|
|
|
|
|
|
this.listQuery.itemId = res[0].itemId
|
|
|
|
|
|
|
|
this.listQuery.current = res[0].current
|
|
|
|
|
|
|
|
this.listQuery.tpId = res[0].tpId,
|
|
|
|
|
|
|
|
this.listQuery.identify = res[0].identify
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
threadPoolSelectList() {
|
|
|
|
//线程池配置
|
|
|
|
this.listQuery.identify = null;
|
|
|
|
threadPoolApi.info(this.listQuery).then((res) => {
|
|
|
|
this.identifyOptions = [];
|
|
|
|
this.temp = res;
|
|
|
|
const listArray = [this.listQuery.itemId, this.listQuery.tpId];
|
|
|
|
this.tableData = [{
|
|
|
|
instanceApi.list(listArray).then((res) => {
|
|
|
|
name: '租户',
|
|
|
|
this.identifyOptions =
|
|
|
|
label: res.tenantId
|
|
|
|
res &&
|
|
|
|
}, {
|
|
|
|
res.map((item) => {
|
|
|
|
name: '线程池',
|
|
|
|
return {
|
|
|
|
label: res.tpId
|
|
|
|
key: item.identify,
|
|
|
|
}, {
|
|
|
|
display_name: item.clientAddress,
|
|
|
|
name: '核心线程池',
|
|
|
|
};
|
|
|
|
label: res.coreSize
|
|
|
|
});
|
|
|
|
}, {
|
|
|
|
|
|
|
|
// name: '项目',
|
|
|
|
|
|
|
|
// label: res.itemId
|
|
|
|
|
|
|
|
// }, {
|
|
|
|
|
|
|
|
name: '拒绝次数',
|
|
|
|
|
|
|
|
label: res.rejectedType
|
|
|
|
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
initChart() {
|
|
|
|
fetchChartData() {
|
|
|
|
monitorApi.active(this.listQuery).then((res) => {
|
|
|
|
monitorApi.active( this.listQuery).then(res => {
|
|
|
|
const {
|
|
|
|
this.monitor = res
|
|
|
|
poolSizeList,
|
|
|
|
this.lineChartData = [
|
|
|
|
activeSizeList,
|
|
|
|
{
|
|
|
|
queueSizeList,
|
|
|
|
name: '区间任务完成数',
|
|
|
|
queueRemainingCapacityList,
|
|
|
|
data: res?.rangeCompletedTaskCountList,
|
|
|
|
completedTaskCountList,
|
|
|
|
show: true
|
|
|
|
rejectCountList,
|
|
|
|
}, {
|
|
|
|
times,
|
|
|
|
name: '拒绝总数',
|
|
|
|
} = res || {};
|
|
|
|
data: res?.rejectCountList,
|
|
|
|
this.times = times;
|
|
|
|
show: false,
|
|
|
|
this.lineChartData1[0].data = activeSizeList;
|
|
|
|
itemStyle: {
|
|
|
|
this.lineChartData2[0].data = poolSizeList;
|
|
|
|
opacity: 0,
|
|
|
|
this.lineChartData3[0].data = queueSizeList;
|
|
|
|
},
|
|
|
|
this.lineChartData4[0].data = queueRemainingCapacityList;
|
|
|
|
textStyle: {
|
|
|
|
this.lineChartData5[0].data = completedTaskCountList;
|
|
|
|
opacity: 0,
|
|
|
|
this.lineChartData6[0].data = rejectCountList;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}, {
|
|
|
|
|
|
|
|
name: '任务总数',
|
|
|
|
|
|
|
|
data: res?.completedTaskCountList,
|
|
|
|
|
|
|
|
show: false,
|
|
|
|
|
|
|
|
itemStyle: {
|
|
|
|
|
|
|
|
opacity: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
textStyle: {
|
|
|
|
|
|
|
|
opacity: 0,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},]
|
|
|
|
|
|
|
|
this.times = res?.times.map(item => {
|
|
|
|
|
|
|
|
const list = item.split(':')
|
|
|
|
|
|
|
|
list.pop()
|
|
|
|
|
|
|
|
return list.join(':')
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
console.log
|
|
|
|
|
|
|
|
this.activeSizeList = [{
|
|
|
|
|
|
|
|
name: '活跃线程数',
|
|
|
|
|
|
|
|
data: res?.activeSizeList,
|
|
|
|
|
|
|
|
show: true,
|
|
|
|
|
|
|
|
num: res?.activeSizeList[res.activeSizeList.length - 1]
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
this.poolSizeList = [{
|
|
|
|
|
|
|
|
name: '线程数',
|
|
|
|
|
|
|
|
data: res?.poolSizeList,
|
|
|
|
|
|
|
|
show: true
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
this.queueSizeList = [{
|
|
|
|
|
|
|
|
name: '队列元素数',
|
|
|
|
|
|
|
|
data: res?.queueSizeList,
|
|
|
|
|
|
|
|
show: true
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
this.rangeRejectCountList = [{
|
|
|
|
|
|
|
|
name: '拒绝数',
|
|
|
|
|
|
|
|
data: res?.rangeRejectCountList,
|
|
|
|
|
|
|
|
show: true
|
|
|
|
|
|
|
|
}]
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changeMonitorData(value, row) {
|
|
|
|
|
|
|
|
console.log("time", value)
|
|
|
|
|
|
|
|
this.listQuery.startTime = value[0]
|
|
|
|
|
|
|
|
this.listQuery.endTime = value[1]
|
|
|
|
|
|
|
|
this.fetchChartData()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
handleChangeMonitorSelect(value) {
|
|
|
|
|
|
|
|
console.log("asaksasa", value)
|
|
|
|
|
|
|
|
this.selectMonitor[value[0]].map((item) => {
|
|
|
|
|
|
|
|
if (item.children.label == value[1]) {
|
|
|
|
|
|
|
|
this.listQuery.identify = item.identify || this.listQuery.identify
|
|
|
|
|
|
|
|
this.listQuery.tenantId = item.tenantId || this.listQuery.tenantId
|
|
|
|
|
|
|
|
this.listQuery.itemId = item.itemId || this.listQuery.itemId
|
|
|
|
|
|
|
|
this.listQuery.instanceId = item.current || this.listQuery.instanceId
|
|
|
|
|
|
|
|
this.listQuery.tpId = item.tpId || this.listQuery.tpId
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.dashboard-editor-container {
|
|
|
|
.monitor-wrapper {
|
|
|
|
padding: 32px;
|
|
|
|
width: 100%;
|
|
|
|
background-color: rgb(240, 242, 245);
|
|
|
|
height: calc(100vh - 50px);
|
|
|
|
/* background-color: #2f4256; */
|
|
|
|
display: grid;
|
|
|
|
position: relative;
|
|
|
|
grid-template-rows: 60px 1fr 2fr;
|
|
|
|
min-height: 100vh;
|
|
|
|
grid-template-columns: 240px 2fr 1fr;
|
|
|
|
|
|
|
|
background-color: #ebebf3;
|
|
|
|
|
|
|
|
gap: 10px;
|
|
|
|
|
|
|
|
padding: 10px;
|
|
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>div {
|
|
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
|
|
padding: 12px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.chart-title {
|
|
|
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
|
|
|
font-weight: bolder;
|
|
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.info-wrapper::-webkit-scrollbar {
|
|
|
|
|
|
|
|
display: none; /*隐藏滚动条*/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.info-wrapper {
|
|
|
|
|
|
|
|
grid-row: 1 / 4;
|
|
|
|
|
|
|
|
grid-column: 1 / 2;
|
|
|
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
|
|
|
overflow-y: scroll;
|
|
|
|
|
|
|
|
.top-card {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
justify-content: space-around;
|
|
|
|
|
|
|
|
padding: 20px 0;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
color: rgba($color: #435f81, $alpha: 0.9);
|
|
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
|
|
.svg-icon {
|
|
|
|
|
|
|
|
width: 60px;
|
|
|
|
|
|
|
|
height: 60px;
|
|
|
|
|
|
|
|
left: 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.top-icon {
|
|
|
|
|
|
|
|
width: 40px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.query-monitoring {
|
|
|
|
|
|
|
|
margin-bottom: 30px;
|
|
|
|
|
|
|
|
.title {
|
|
|
|
|
|
|
|
padding: 0 0 10px 5px;
|
|
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
|
|
color: rgba($color: #435f81, $alpha: 0.9);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.el-cascader {
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.info-card {
|
|
|
|
|
|
|
|
// background: #435f81;
|
|
|
|
|
|
|
|
background-color: rgba($color: #435f81, $alpha: 0.9);
|
|
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
|
|
padding: 20px;
|
|
|
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
|
|
|
color: #fefefe;
|
|
|
|
|
|
|
|
font-family: HelveticaNeue-Medium,Helvetica Medium,PingFangSC-Medium,STHeitiSC-Medium,Microsoft YaHei Bold,Arial,sans-serif;
|
|
|
|
|
|
|
|
.info-card-title, .data-num {
|
|
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
|
|
|
padding-bottom: 10px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.num {
|
|
|
|
|
|
|
|
font-family: DIDIFD-Regular;
|
|
|
|
|
|
|
|
font-size: 40px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.operation-list {
|
|
|
|
|
|
|
|
color: darkgray;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.tp-card {
|
|
|
|
|
|
|
|
// background: rgb(237, 237, 237);
|
|
|
|
|
|
|
|
border: 1px solid #dfe6ec;
|
|
|
|
|
|
|
|
padding: 20px 10px 30px 10px;
|
|
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
|
|
background-color: rgba($color: #435f81, $alpha: 0.9);
|
|
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
|
|
.tp-item {
|
|
|
|
|
|
|
|
border-bottom: 1px solid #e3e3e3;
|
|
|
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
.tp-label {
|
|
|
|
|
|
|
|
width: 600;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.search-wrapper {
|
|
|
|
|
|
|
|
grid-row: 1 / 2;
|
|
|
|
|
|
|
|
grid-column: 2 / 4;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
.demonstration {
|
|
|
|
|
|
|
|
margin: 0 10px;
|
|
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
|
|
color: #3a3b3c;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.center-chart-wrapper {
|
|
|
|
|
|
|
|
grid-row: 2 / 3;
|
|
|
|
|
|
|
|
grid-column: 2 / 4;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.bottom-chart-wraper {
|
|
|
|
|
|
|
|
grid-row: 3 / 4;
|
|
|
|
|
|
|
|
grid-column: 2 / 4;
|
|
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
|
|
grid-template-columns: 1fr 1fr;
|
|
|
|
|
|
|
|
grid-template-rows: 1fr 1fr;
|
|
|
|
|
|
|
|
gap: 24px;
|
|
|
|
|
|
|
|
.inner-chart {
|
|
|
|
|
|
|
|
grid-column: span 1;
|
|
|
|
|
|
|
|
grid-row: span 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|