mirror of https://github.com/jeecgboot/jeecg-boot
删除性能监控,后期重构UI
parent
89f85fb6d1
commit
58d0ad6c38
|
@ -1,150 +0,0 @@
|
|||
<template>
|
||||
<a-card :bordered="false" class="card-area">
|
||||
<div>
|
||||
<div class="alert">
|
||||
<a-alert type="success" :show-icon="true">
|
||||
<div slot="message">
|
||||
共追踪到 {{dataSource.length}} 条近期HTTP请求记录
|
||||
<a style="margin-left: 24px" @click="search">点击刷新</a>
|
||||
</div>
|
||||
</a-alert>
|
||||
</div>
|
||||
<!-- 表格区域 -->
|
||||
<a-table :columns="columns"
|
||||
:dataSource="dataSource"
|
||||
:pagination="pagination"
|
||||
:loading="loading"
|
||||
:scroll="{ x: 900 }"
|
||||
@change="handleTableChange">
|
||||
</a-table>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment'
|
||||
moment.locale('zh-cn')
|
||||
import {getAction} from '@/api/manage'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
advanced: false,
|
||||
dataSource: [],
|
||||
pagination: {
|
||||
defaultPageSize: 10,
|
||||
defaultCurrent: 1,
|
||||
pageSizeOptions: ['10', '20', '30', '40', '100'],
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
showTotal: (total, range) => `显示 ${range[0]} ~ ${range[1]} 条记录,共 ${total} 条记录`
|
||||
},
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
columns () {
|
||||
return [{
|
||||
title: '请求时间',
|
||||
dataIndex: 'timestamp',
|
||||
customRender: (text, row, index) => {
|
||||
return moment(text).format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
}, {
|
||||
title: '请求方法',
|
||||
dataIndex: 'request.method',
|
||||
customRender: (text, row, index) => {
|
||||
switch (text) {
|
||||
case 'GET':
|
||||
return <a-tag color="#87d068">{text}</a-tag>
|
||||
case 'POST':
|
||||
return <a-tag color="#2db7f5">{text}</a-tag>
|
||||
case 'PUT':
|
||||
return <a-tag color="#ffba5a">{text}</a-tag>
|
||||
case 'DELETE':
|
||||
return <a-tag color="#f50">{text}</a-tag>
|
||||
default:
|
||||
return text
|
||||
}
|
||||
},
|
||||
filters: [
|
||||
{ text: 'GET', value: 'GET' },
|
||||
{ text: 'POST', value: 'POST' },
|
||||
{ text: 'PUT', value: 'PUT' },
|
||||
{ text: 'DELETE', value: 'DELETE' }
|
||||
],
|
||||
filterMultiple: true,
|
||||
onFilter: (value, record) => record.request.method.includes(value)
|
||||
}, {
|
||||
title: '请求URL',
|
||||
dataIndex: 'request.uri',
|
||||
customRender: (text, row, index) => {
|
||||
return text.split('?')[0]
|
||||
}
|
||||
}, {
|
||||
title: '响应状态',
|
||||
dataIndex: 'response.status',
|
||||
customRender: (text, row, index) => {
|
||||
if (text < 200) {
|
||||
return <a-tag color="pink">{text}</a-tag>
|
||||
} else if (text < 201) {
|
||||
return <a-tag color="green">{text}</a-tag>
|
||||
} else if (text < 399) {
|
||||
return <a-tag color="cyan">{text}</a-tag>
|
||||
} else if (text < 403) {
|
||||
return <a-tag color="orange">{text}</a-tag>
|
||||
} else if (text < 501) {
|
||||
return <a-tag color="red">{text}</a-tag>
|
||||
} else {
|
||||
return text
|
||||
}
|
||||
}
|
||||
}, {
|
||||
title: '请求耗时',
|
||||
dataIndex: 'timeTaken',
|
||||
customRender: (text, row, index) => {
|
||||
if (text < 500) {
|
||||
return <a-tag color="green">{text} ms</a-tag>
|
||||
} else if (text < 1000) {
|
||||
return <a-tag color="cyan">{text} ms</a-tag>
|
||||
} else if (text < 1500) {
|
||||
return <a-tag color="orange">{text} ms</a-tag>
|
||||
} else {
|
||||
return <a-tag color="red">{text} ms</a-tag>
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.fetch()
|
||||
},
|
||||
methods: {
|
||||
search () {
|
||||
this.fetch()
|
||||
},
|
||||
handleTableChange (pagination, filters, sorter) {
|
||||
this.fetch()
|
||||
},
|
||||
fetch () {
|
||||
this.loading = true
|
||||
getAction('actuator/httptrace').then((data) => {
|
||||
this.loading = false
|
||||
let filterData = []
|
||||
for (let d of data.traces) {
|
||||
if (d.request.method !== 'OPTIONS' && d.request.uri.indexOf('httptrace') === -1) {
|
||||
filterData.push(d)
|
||||
}
|
||||
}
|
||||
this.dataSource = filterData
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.alert {
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
</style>
|
|
@ -1,256 +0,0 @@
|
|||
<template>
|
||||
<a-skeleton active :loading="loading" :paragraph="{rows: 17}">
|
||||
<div class="jvm-info" style="background-color: #ffffff">
|
||||
<div class="alert">
|
||||
<a-alert type="success" :show-icon="true">
|
||||
<div slot="message">
|
||||
数据获取时间 {{this.time}}
|
||||
<a style="margin-left: 24px" @click="create">点击刷新</a>
|
||||
</div>
|
||||
</a-alert>
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>描述</th>
|
||||
<th>当前值</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="purple">jvm.memory.max</a-tag>
|
||||
</td>
|
||||
<td>JVM 最大内存</td>
|
||||
<td>{{jvm.memory.max}} MB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="purple">jvm.memory.committed</a-tag>
|
||||
</td>
|
||||
<td>JVM 可用内存</td>
|
||||
<td>{{jvm.memory.committed}} MB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="purple">jvm.memory.used</a-tag>
|
||||
</td>
|
||||
<td>JVM 已用内存</td>
|
||||
<td>{{jvm.memory.used}} MB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="cyan">jvm.buffer.memory.used</a-tag>
|
||||
</td>
|
||||
<td>JVM 缓冲区已用内存</td>
|
||||
<td>{{jvm.buffer.memory.used}} MB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="cyan">jvm.buffer.count</a-tag>
|
||||
</td>
|
||||
<td>当前缓冲区数量</td>
|
||||
<td>{{jvm.buffer.count}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="green">jvm.threads.daemon</a-tag>
|
||||
</td>
|
||||
<td>JVM 守护线程数量</td>
|
||||
<td>{{jvm.threads.daemon}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="green">jvm.threads.live</a-tag>
|
||||
</td>
|
||||
<td>JVM 当前活跃线程数量</td>
|
||||
<td>{{jvm.threads.live}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="green">jvm.threads.peak</a-tag>
|
||||
</td>
|
||||
<td>JVM 峰值线程数量</td>
|
||||
<td>{{jvm.threads.peak}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="orange">jvm.classes.loaded</a-tag>
|
||||
</td>
|
||||
<td>JVM 已加载 Class 数量</td>
|
||||
<td>{{jvm.classes.loaded}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="orange">jvm.classes.unloaded</a-tag>
|
||||
</td>
|
||||
<td>JVM 未加载 Class 数量</td>
|
||||
<td>{{jvm.classes.unloaded}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="pink">jvm.gc.memory.allocated</a-tag>
|
||||
</td>
|
||||
<td>GC 时, 年轻代分配的内存空间</td>
|
||||
<td>{{jvm.gc.memory.allocated}} MB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="pink">jvm.gc.memory.promoted</a-tag>
|
||||
</td>
|
||||
<td>GC 时, 老年代分配的内存空间</td>
|
||||
<td>{{jvm.gc.memory.promoted}} MB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="pink">jvm.gc.max.data.size</a-tag>
|
||||
</td>
|
||||
<td>GC 时, 老年代的最大内存空间</td>
|
||||
<td>{{jvm.gc.maxDataSize}} MB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="pink">jvm.gc.live.data.size</a-tag>
|
||||
</td>
|
||||
<td>FullGC 时, 老年代的内存空间</td>
|
||||
<td>{{jvm.gc.liveDataSize}} MB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="blue">jvm.gc.pause.count</a-tag>
|
||||
</td>
|
||||
<td>系统启动以来GC 次数</td>
|
||||
<td>{{jvm.gc.pause.count}} 次</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a-tag color="blue">jvm.gc.pause.totalTime</a-tag>
|
||||
</td>
|
||||
<td>系统启动以来GC 总耗时</td>
|
||||
<td>{{jvm.gc.pause.totalTime}} 秒</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</a-skeleton>
|
||||
</template>
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
import {getAction} from '@/api/manage'
|
||||
moment.locale('zh-cn')
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
time: '',
|
||||
loading: true,
|
||||
jvm: {
|
||||
memory: {
|
||||
max: 0,
|
||||
committed: 0,
|
||||
used: 0
|
||||
},
|
||||
buffer: {
|
||||
memory: {
|
||||
used: 0
|
||||
},
|
||||
count: 0
|
||||
},
|
||||
threads: {
|
||||
daemon: 0,
|
||||
live: 0,
|
||||
peak: 0
|
||||
},
|
||||
classes: {
|
||||
loaded: 0,
|
||||
unloaded: 0
|
||||
},
|
||||
gc: {
|
||||
memory: {
|
||||
allocated: 0,
|
||||
promoted: 0
|
||||
},
|
||||
maxDataSize: 0,
|
||||
liveDataSize: 0,
|
||||
pause: {
|
||||
totalTime: 0,
|
||||
count: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.create()
|
||||
},
|
||||
methods: {
|
||||
create() {
|
||||
this.time = moment().format('YYYY年MM月DD日 HH时mm分ss秒')
|
||||
axios.all([
|
||||
getAction('actuator/metrics/jvm.memory.max'),
|
||||
getAction('actuator/metrics/jvm.memory.committed'),
|
||||
getAction('actuator/metrics/jvm.memory.used'),
|
||||
getAction('actuator/metrics/jvm.buffer.memory.used'),
|
||||
getAction('actuator/metrics/jvm.buffer.count'),
|
||||
getAction('actuator/metrics/jvm.threads.daemon'),
|
||||
getAction('actuator/metrics/jvm.threads.live'),
|
||||
getAction('actuator/metrics/jvm.threads.peak'),
|
||||
getAction('actuator/metrics/jvm.classes.loaded'),
|
||||
getAction('actuator/metrics/jvm.classes.unloaded'),
|
||||
getAction('actuator/metrics/jvm.gc.memory.allocated'),
|
||||
getAction('actuator/metrics/jvm.gc.memory.promoted'),
|
||||
getAction('actuator/metrics/jvm.gc.max.data.size'),
|
||||
getAction('actuator/metrics/jvm.gc.live.data.size'),
|
||||
getAction('actuator/metrics/jvm.gc.pause')
|
||||
]).then((r) => {
|
||||
this.jvm.memory.max = this.convert(r[0].measurements[0].value)
|
||||
this.jvm.memory.committed = this.convert(r[1].measurements[0].value)
|
||||
this.jvm.memory.used = this.convert(r[2].measurements[0].value)
|
||||
this.jvm.buffer.memory.used = this.convert(r[3].measurements[0].value)
|
||||
this.jvm.buffer.count = r[4].measurements[0].value
|
||||
this.jvm.threads.daemon = r[5].measurements[0].value
|
||||
this.jvm.threads.live = r[6].measurements[0].value
|
||||
this.jvm.threads.peak = r[7].measurements[0].value
|
||||
this.jvm.classes.loaded = r[8].measurements[0].value
|
||||
this.jvm.classes.unloaded = r[9].measurements[0].value
|
||||
this.jvm.gc.memory.allocated = this.convert(r[10].measurements[0].value)
|
||||
this.jvm.gc.memory.promoted = this.convert(r[11].measurements[0].value)
|
||||
this.jvm.gc.maxDataSize = this.convert(r[12].measurements[0].value)
|
||||
this.jvm.gc.liveDataSize = this.convert(r[13].measurements[0].value)
|
||||
this.jvm.gc.pause.count = r[14].measurements[0].value
|
||||
this.jvm.gc.pause.totalTime = r[14].measurements[1].value
|
||||
this.loading = false
|
||||
}).catch((r) => {
|
||||
console.error(r)
|
||||
this.$message.error('获取JVM信息失败')
|
||||
})
|
||||
},
|
||||
convert(value) {
|
||||
return Number(value / 1048576).toFixed(3)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.jvm-info {
|
||||
width: 100%;
|
||||
table {
|
||||
width: 100%;
|
||||
tr {
|
||||
line-height: 1.5rem;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
th {
|
||||
background: #fafafa;
|
||||
padding: .5rem;
|
||||
}
|
||||
td {
|
||||
padding: .5rem;
|
||||
.ant-tag {
|
||||
font-size: .8rem !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.alert {
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,216 +0,0 @@
|
|||
<template>
|
||||
<div style="width: 100%;margin-top: 1rem;background-color: #ffffff">
|
||||
<a-row :gutter="8">
|
||||
<a-col :span="12">
|
||||
<apexchart ref="memoryInfo" type=area height=350 :options="memory.chartOptions" :series="memory.series" />
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<apexchart ref="keySize" type=area height=350 :options="key.chartOptions" :series="key.series" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="8">
|
||||
<a-divider orientation="left">Redis详细信息</a-divider>
|
||||
<table style="border-bottom: 1px solid #f1f1f1;">
|
||||
<tr v-for="(info, index) in redisInfo" :key="index" style="border-top: 1px solid #f1f1f1;">
|
||||
<td style="padding: .7rem 1rem">{{info.key}}</td>
|
||||
<td style="padding: .7rem 1rem">{{info.description}}</td>
|
||||
<td style="padding: .7rem 1rem">{{info.value}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
import {getAction} from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'RedisInfo',
|
||||
data () {
|
||||
return {
|
||||
loading: true,
|
||||
memory: {
|
||||
series: [],
|
||||
chartOptions: {
|
||||
chart: {
|
||||
animations: {
|
||||
enabled: true,
|
||||
easing: 'linear',
|
||||
dynamicAnimation: {
|
||||
speed: 3000
|
||||
}
|
||||
},
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
zoom: {
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
stroke: {
|
||||
curve: 'smooth'
|
||||
},
|
||||
title: {
|
||||
text: 'Redis内存实时占用情况(kb)',
|
||||
align: 'left'
|
||||
},
|
||||
markers: {
|
||||
size: 0
|
||||
},
|
||||
xaxis: {
|
||||
},
|
||||
yaxis: {},
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
data: [],
|
||||
xdata: []
|
||||
},
|
||||
key: {
|
||||
series: [],
|
||||
chartOptions: {
|
||||
chart: {
|
||||
animations: {
|
||||
enabled: true,
|
||||
easing: 'linear',
|
||||
dynamicAnimation: {
|
||||
speed: 3000
|
||||
}
|
||||
},
|
||||
toolbar: {
|
||||
show: false
|
||||
},
|
||||
zoom: {
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
dataLabels: {
|
||||
enabled: false
|
||||
},
|
||||
colors: ['#f5564e'],
|
||||
stroke: {
|
||||
curve: 'smooth'
|
||||
},
|
||||
title: {
|
||||
text: 'Redis key实时数量(个)',
|
||||
align: 'left'
|
||||
},
|
||||
markers: {
|
||||
size: 0
|
||||
},
|
||||
xaxis: {
|
||||
},
|
||||
yaxis: {},
|
||||
legend: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
data: [],
|
||||
xdata: []
|
||||
},
|
||||
redisInfo: [],
|
||||
timer: null
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
let minMemory = 1e10
|
||||
let minSize = 1e10
|
||||
let maxMemory = -1e10
|
||||
let maxSize = -1e10
|
||||
this.timer = setInterval(() => {
|
||||
if (this.$route.path.indexOf('redis') !== -1) {
|
||||
axios.all([
|
||||
getAction('redis/keysSize'),
|
||||
getAction('redis/memoryInfo')
|
||||
]).then((r) => {
|
||||
console.log(r)
|
||||
let currentMemory = r[1].used_memory / 1000
|
||||
let currentSize = r[0].dbSize
|
||||
if (currentMemory < minMemory) {
|
||||
minMemory = currentMemory
|
||||
}
|
||||
if (currentMemory > maxMemory) {
|
||||
maxMemory = currentMemory
|
||||
}
|
||||
if (currentSize < minSize) {
|
||||
minSize = currentSize
|
||||
}
|
||||
if (currentSize > maxSize) {
|
||||
maxSize = currentSize
|
||||
}
|
||||
let time = moment().format('hh:mm:ss')
|
||||
this.memory.data.push(currentMemory)
|
||||
this.memory.xdata.push(time)
|
||||
this.key.data.push(currentSize)
|
||||
this.key.xdata.push(time)
|
||||
if (this.memory.data.length >= 6) {
|
||||
this.memory.data.shift()
|
||||
this.memory.xdata.shift()
|
||||
}
|
||||
if (this.key.data.length >= 6) {
|
||||
this.key.data.shift()
|
||||
this.key.xdata.shift()
|
||||
}
|
||||
this.$refs.memoryInfo.updateSeries([
|
||||
{
|
||||
name: '内存(kb)',
|
||||
data: this.memory.data.slice()
|
||||
}
|
||||
])
|
||||
this.$refs.memoryInfo.updateOptions({
|
||||
xaxis: {
|
||||
categories: this.memory.xdata.slice()
|
||||
},
|
||||
yaxis: {
|
||||
min: minMemory,
|
||||
max: maxMemory
|
||||
}
|
||||
}, true, true)
|
||||
this.$refs.keySize.updateSeries([
|
||||
{
|
||||
name: 'key数量',
|
||||
data: this.key.data.slice()
|
||||
}
|
||||
])
|
||||
this.$refs.keySize.updateOptions({
|
||||
xaxis: {
|
||||
categories: this.key.xdata.slice()
|
||||
},
|
||||
yaxis: {
|
||||
min: minSize - 2,
|
||||
max: maxSize + 2
|
||||
}
|
||||
}, true, true)
|
||||
if (this.loading) {
|
||||
this.loading = false
|
||||
}
|
||||
}).catch((r) => {
|
||||
console.error(r)
|
||||
this.$message.error('获取Redis信息失败')
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
})
|
||||
}
|
||||
}, 3000)
|
||||
getAction('redis/info').then((r) => {
|
||||
console.log('redis/info')
|
||||
console.log(r)
|
||||
this.redisInfo = r.result
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -1,13 +0,0 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>Redis终端</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'RedisTerminal'
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -1,125 +0,0 @@
|
|||
<template>
|
||||
<a-skeleton active :loading="loading" :paragraph="{rows: 17}">
|
||||
<div class="jvm-info" style="background-color: #ffffff">
|
||||
<div class="alert">
|
||||
<a-alert type="success" :show-icon="true">
|
||||
<div slot="message">
|
||||
数据获取时间 {{this.time}}
|
||||
<a style="margin-left: 24px" @click="create">点击刷新</a>
|
||||
</div>
|
||||
</a-alert>
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>描述</th>
|
||||
<th>当前值</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="green">system.cpu.count</a-tag></td>
|
||||
<td>CPU 数量</td>
|
||||
<td>{{system.cpu.count}} 核</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="green">system.cpu.usage</a-tag></td>
|
||||
<td>系统 CPU 使用率</td>
|
||||
<td>{{system.cpu.usage}} %</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="purple">process.start.time</a-tag></td>
|
||||
<td>应用启动时间点</td>
|
||||
<td>{{system.process.startTime}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="purple">process.uptime</a-tag></td>
|
||||
<td>应用已运行时间</td>
|
||||
<td>{{system.process.uptime}} 秒</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="purple">process.cpu.usage</a-tag></td>
|
||||
<td>当前应用 CPU 使用率</td>
|
||||
<td>{{system.process.cpuUsage}} %</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</a-skeleton>
|
||||
</template>
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
import {getAction} from '@/api/manage'
|
||||
moment.locale('zh-cn')
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
time: '',
|
||||
loading: true,
|
||||
system: {
|
||||
cpu: {
|
||||
count: 0,
|
||||
usage: 0
|
||||
},
|
||||
process: {
|
||||
cpuUsage: 0,
|
||||
uptime: 0,
|
||||
startTime: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.create()
|
||||
},
|
||||
methods: {
|
||||
create () {
|
||||
this.time = moment().format('YYYY年MM月DD日 HH时mm分ss秒')
|
||||
axios.all([
|
||||
getAction('actuator/metrics/system.cpu.count'),
|
||||
getAction('actuator/metrics/system.cpu.usage'),
|
||||
getAction('actuator/metrics/process.uptime'),
|
||||
getAction('actuator/metrics/process.start.time'),
|
||||
getAction('actuator/metrics/process.cpu.usage')
|
||||
]).then((r) => {
|
||||
this.system.cpu.count = r[0].measurements[0].value
|
||||
this.system.cpu.usage = this.convert(r[1].measurements[0].value)
|
||||
this.system.process.uptime = r[2].measurements[0].value
|
||||
this.system.process.startTime = moment(r[3].measurements[0].value * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||
this.system.process.cpuUsage = this.convert(r[4].measurements[0].value)
|
||||
this.loading = false
|
||||
}).catch((r) => {
|
||||
console.error(r)
|
||||
this.$message.error('获取服务器信息失败')
|
||||
})
|
||||
},
|
||||
convert (value) {
|
||||
return Number(value * 100).toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.jvm-info {
|
||||
width: 100%;
|
||||
table {
|
||||
width: 100%;
|
||||
tr {
|
||||
line-height: 1.5rem;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
th {
|
||||
background: #fafafa;
|
||||
padding: .5rem;
|
||||
}
|
||||
td {
|
||||
padding: .5rem;
|
||||
.ant-tag {
|
||||
font-size: .8rem !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.alert {
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,202 +0,0 @@
|
|||
<template>
|
||||
<a-skeleton active :loading="loading" :paragraph="{rows: 17}">
|
||||
<div class="jvm-info" style="background-color: #ffffff">
|
||||
<div class="alert">
|
||||
<a-alert type="success" :show-icon="true">
|
||||
<div slot="message">
|
||||
数据获取时间 {{this.time}}
|
||||
<a style="margin-left: 24px" @click="create">点击刷新</a>
|
||||
</div>
|
||||
</a-alert>
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<th>参数</th>
|
||||
<th>描述</th>
|
||||
<th>当前值</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="green">tomcat.sessions.created</a-tag></td>
|
||||
<td>tomcat 已创建 session 数</td>
|
||||
<td>{{tomcat.sessions.created}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="green">tomcat.sessions.expired</a-tag></td>
|
||||
<td>tomcat 已过期 session 数</td>
|
||||
<td>{{tomcat.sessions.expired}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="green">tomcat.sessions.active.current</a-tag></td>
|
||||
<td>tomcat 当前活跃 session 数</td>
|
||||
<td>{{tomcat.sessions.active.current}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="green">tomcat.sessions.active.max</a-tag></td>
|
||||
<td>tomcat 活跃 session 数峰值</td>
|
||||
<td>{{tomcat.sessions.active.max}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="green">tomcat.sessions.rejected</a-tag></td>
|
||||
<td>超过session 最大配置后,拒绝的 session 个数</td>
|
||||
<td>{{tomcat.sessions.rejected}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="purple">tomcat.global.sent</a-tag></td>
|
||||
<td>发送的字节数</td>
|
||||
<td>{{tomcat.global.sent}} bytes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="purple">tomcat.global.request.max</a-tag></td>
|
||||
<td>request 请求最长耗时</td>
|
||||
<td>{{tomcat.global.request.max}} 秒</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="purple">tomcat.global.request.count</a-tag></td>
|
||||
<td>全局 request 请求次数</td>
|
||||
<td>{{tomcat.global.request.count}} 次</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="purple">tomcat.global.request.totalTime</a-tag></td>
|
||||
<td>全局 request 请求总耗时</td>
|
||||
<td>{{tomcat.global.request.totalTime}} 秒</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="cyan">tomcat.servlet.request.max</a-tag></td>
|
||||
<td>servlet 请求最长耗时</td>
|
||||
<td>{{tomcat.servlet.request.max}} 秒</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="cyan">tomcat.servlet.request.count</a-tag></td>
|
||||
<td>servlet 总请求次数</td>
|
||||
<td>{{tomcat.servlet.request.count}} 次</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="cyan">tomcat.servlet.request.totalTime</a-tag></td>
|
||||
<td>servlet 请求总耗时</td>
|
||||
<td>{{tomcat.servlet.request.totalTime}} 秒</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="pink">tomcat.threads.current</a-tag></td>
|
||||
<td>tomcat 当前线程数(包括守护线程)</td>
|
||||
<td>{{tomcat.threads.current}} 个</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a-tag color="pink">tomcat.threads.configMax</a-tag></td>
|
||||
<td>tomcat 配置的线程最大数</td>
|
||||
<td>{{tomcat.threads.configMax}} 个</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</a-skeleton>
|
||||
</template>
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import moment from 'moment'
|
||||
import {getAction} from '@/api/manage'
|
||||
moment.locale('zh-cn')
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
time: '',
|
||||
loading: true,
|
||||
tomcat: {
|
||||
sessions: {
|
||||
created: 0,
|
||||
expired: 0,
|
||||
active: {
|
||||
current: 0,
|
||||
max: 0
|
||||
},
|
||||
rejected: 0
|
||||
},
|
||||
global: {
|
||||
sent: 0,
|
||||
request: {
|
||||
count: 0,
|
||||
max: 0,
|
||||
totalTime: 0
|
||||
}
|
||||
},
|
||||
servlet: {
|
||||
request: {
|
||||
count: 0,
|
||||
totalTime: 0,
|
||||
max: 0
|
||||
}
|
||||
},
|
||||
threads: {
|
||||
current: 0,
|
||||
configMax: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.create()
|
||||
},
|
||||
methods: {
|
||||
create () {
|
||||
this.time = moment().format('YYYY年MM月DD日 HH时mm分ss秒')
|
||||
axios.all([
|
||||
getAction('actuator/metrics/tomcat.sessions.created'),
|
||||
getAction('actuator/metrics/tomcat.sessions.expired'),
|
||||
getAction('actuator/metrics/tomcat.sessions.active.current'),
|
||||
getAction('actuator/metrics/tomcat.sessions.active.max'),
|
||||
getAction('actuator/metrics/tomcat.sessions.rejected'),
|
||||
getAction('actuator/metrics/tomcat.global.sent'),
|
||||
getAction('actuator/metrics/tomcat.global.request.max'),
|
||||
getAction('actuator/metrics/tomcat.global.request'),
|
||||
getAction('actuator/metrics/tomcat.servlet.request'),
|
||||
getAction('actuator/metrics/tomcat.servlet.request.max'),
|
||||
getAction('actuator/metrics/tomcat.threads.current'),
|
||||
getAction('actuator/metrics/tomcat.threads.config.max')
|
||||
]).then((r) => {
|
||||
this.tomcat.sessions.created = r[0].measurements[0].value
|
||||
this.tomcat.sessions.expired = r[1].measurements[0].value
|
||||
this.tomcat.sessions.active.current = r[2].measurements[0].value
|
||||
this.tomcat.sessions.active.max = r[3].measurements[0].value
|
||||
this.tomcat.sessions.rejected = r[4].measurements[0].value
|
||||
this.tomcat.global.sent = r[5].measurements[0].value
|
||||
this.tomcat.global.request.max = r[6].measurements[0].value
|
||||
this.tomcat.global.request.count = r[7].measurements[0].value
|
||||
this.tomcat.global.request.totalTime = r[7].measurements[1].value
|
||||
this.tomcat.servlet.request.count = r[8].measurements[0].value
|
||||
this.tomcat.servlet.request.totalTime = r[8].measurements[1].value
|
||||
this.tomcat.servlet.request.max = r[9].measurements[0].value
|
||||
this.tomcat.threads.current = r[10].measurements[0].value
|
||||
this.tomcat.threads.configMax = r[11].measurements[0].value
|
||||
this.loading = false
|
||||
}).catch((r) => {
|
||||
console.error(r)
|
||||
this.$message.error('获取Tomcat信息失败')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.jvm-info {
|
||||
width: 100%;
|
||||
table {
|
||||
width: 100%;
|
||||
tr {
|
||||
line-height: 1.5rem;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
th {
|
||||
background: #fafafa;
|
||||
padding: .5rem;
|
||||
}
|
||||
td {
|
||||
padding: .5rem;
|
||||
.ant-tag {
|
||||
font-size: .8rem !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.alert {
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -2392,3 +2392,4 @@ INSERT INTO `sys_user_role` VALUES ('6ec01b4aaab790eac4ddb33d7a524a58', 'e9ca23d
|
|||
INSERT INTO `sys_user_role` VALUES ('d2233e5be091d39da5abb0073c766224', 'f0019fdebedb443c98dcb17d88222c38', 'ee8626f80f7c2619917b6236f3a7f02b');
|
||||
|
||||
UPDATE `sys_permission` SET `component`='/jeecg/PrintDemo' WHERE (`id`='e6bfd1fcabfd7942fdd05f076d1dad38');
|
||||
delete from sys_permission where id = '700b7f95165c46cc7a78bf227aa8fed3'
|
Loading…
Reference in New Issue