Commit 14fd8283bf10c6dfffcba2dae38ccd08fbd6c59f

Authored by zhangdaihao
1 parent 663b4c00

删除性能监控,后期重构

ant-design-jeecg-vue/src/views/monitor/HttpTrace.vue deleted
1 -<template>  
2 - <a-card :bordered="false" class="card-area">  
3 - <div>  
4 - <div class="alert">  
5 - <a-alert type="success" :show-icon="true">  
6 - <div slot="message">  
7 - 共追踪到 {{dataSource.length}} 条近期HTTP请求记录  
8 - <a style="margin-left: 24px" @click="search">点击刷新</a>  
9 - </div>  
10 - </a-alert>  
11 - </div>  
12 - <!-- 表格区域 -->  
13 - <a-table :columns="columns"  
14 - :dataSource="dataSource"  
15 - :pagination="pagination"  
16 - :loading="loading"  
17 - :scroll="{ x: 900 }"  
18 - @change="handleTableChange">  
19 - </a-table>  
20 - </div>  
21 - </a-card>  
22 -</template>  
23 -  
24 -<script>  
25 -import moment from 'moment'  
26 -moment.locale('zh-cn')  
27 -import {getAction} from '@/api/manage'  
28 -  
29 -export default {  
30 - data () {  
31 - return {  
32 - advanced: false,  
33 - dataSource: [],  
34 - pagination: {  
35 - defaultPageSize: 10,  
36 - defaultCurrent: 1,  
37 - pageSizeOptions: ['10', '20', '30', '40', '100'],  
38 - showQuickJumper: true,  
39 - showSizeChanger: true,  
40 - showTotal: (total, range) => `显示 ${range[0]} ~ ${range[1]} 条记录,共 ${total} 条记录`  
41 - },  
42 - loading: false  
43 - }  
44 - },  
45 - computed: {  
46 - columns () {  
47 - return [{  
48 - title: '请求时间',  
49 - dataIndex: 'timestamp',  
50 - customRender: (text, row, index) => {  
51 - return moment(text).format('YYYY-MM-DD HH:mm:ss')  
52 - }  
53 - }, {  
54 - title: '请求方法',  
55 - dataIndex: 'request.method',  
56 - customRender: (text, row, index) => {  
57 - switch (text) {  
58 - case 'GET':  
59 - return <a-tag color="#87d068">{text}</a-tag>  
60 - case 'POST':  
61 - return <a-tag color="#2db7f5">{text}</a-tag>  
62 - case 'PUT':  
63 - return <a-tag color="#ffba5a">{text}</a-tag>  
64 - case 'DELETE':  
65 - return <a-tag color="#f50">{text}</a-tag>  
66 - default:  
67 - return text  
68 - }  
69 - },  
70 - filters: [  
71 - { text: 'GET', value: 'GET' },  
72 - { text: 'POST', value: 'POST' },  
73 - { text: 'PUT', value: 'PUT' },  
74 - { text: 'DELETE', value: 'DELETE' }  
75 - ],  
76 - filterMultiple: true,  
77 - onFilter: (value, record) => record.request.method.includes(value)  
78 - }, {  
79 - title: '请求URL',  
80 - dataIndex: 'request.uri',  
81 - customRender: (text, row, index) => {  
82 - return text.split('?')[0]  
83 - }  
84 - }, {  
85 - title: '响应状态',  
86 - dataIndex: 'response.status',  
87 - customRender: (text, row, index) => {  
88 - if (text < 200) {  
89 - return <a-tag color="pink">{text}</a-tag>  
90 - } else if (text < 201) {  
91 - return <a-tag color="green">{text}</a-tag>  
92 - } else if (text < 399) {  
93 - return <a-tag color="cyan">{text}</a-tag>  
94 - } else if (text < 403) {  
95 - return <a-tag color="orange">{text}</a-tag>  
96 - } else if (text < 501) {  
97 - return <a-tag color="red">{text}</a-tag>  
98 - } else {  
99 - return text  
100 - }  
101 - }  
102 - }, {  
103 - title: '请求耗时',  
104 - dataIndex: 'timeTaken',  
105 - customRender: (text, row, index) => {  
106 - if (text < 500) {  
107 - return <a-tag color="green">{text} ms</a-tag>  
108 - } else if (text < 1000) {  
109 - return <a-tag color="cyan">{text} ms</a-tag>  
110 - } else if (text < 1500) {  
111 - return <a-tag color="orange">{text} ms</a-tag>  
112 - } else {  
113 - return <a-tag color="red">{text} ms</a-tag>  
114 - }  
115 - }  
116 - }]  
117 - }  
118 - },  
119 - mounted () {  
120 - this.fetch()  
121 - },  
122 - methods: {  
123 - search () {  
124 - this.fetch()  
125 - },  
126 - handleTableChange (pagination, filters, sorter) {  
127 - this.fetch()  
128 - },  
129 - fetch () {  
130 - this.loading = true  
131 - getAction('actuator/httptrace').then((data) => {  
132 - this.loading = false  
133 - let filterData = []  
134 - for (let d of data.traces) {  
135 - if (d.request.method !== 'OPTIONS' && d.request.uri.indexOf('httptrace') === -1) {  
136 - filterData.push(d)  
137 - }  
138 - }  
139 - this.dataSource = filterData  
140 - })  
141 - }  
142 - }  
143 -}  
144 -</script>  
145 -  
146 -<style lang="less" scoped>  
147 - .alert {  
148 - margin-bottom: .5rem;  
149 - }  
150 -</style>  
ant-design-jeecg-vue/src/views/monitor/JvmInfo.vue deleted
1 -<template>  
2 - <a-skeleton active :loading="loading" :paragraph="{rows: 17}">  
3 - <div class="jvm-info" style="background-color: #ffffff">  
4 - <div class="alert">  
5 - <a-alert type="success" :show-icon="true">  
6 - <div slot="message">  
7 - 数据获取时间 {{this.time}}  
8 - <a style="margin-left: 24px" @click="create">点击刷新</a>  
9 - </div>  
10 - </a-alert>  
11 - </div>  
12 - <table>  
13 - <tr>  
14 - <th>参数</th>  
15 - <th>描述</th>  
16 - <th>当前值</th>  
17 - </tr>  
18 - <tr>  
19 - <td>  
20 - <a-tag color="purple">jvm.memory.max</a-tag>  
21 - </td>  
22 - <td>JVM 最大内存</td>  
23 - <td>{{jvm.memory.max}} MB</td>  
24 - </tr>  
25 - <tr>  
26 - <td>  
27 - <a-tag color="purple">jvm.memory.committed</a-tag>  
28 - </td>  
29 - <td>JVM 可用内存</td>  
30 - <td>{{jvm.memory.committed}} MB</td>  
31 - </tr>  
32 - <tr>  
33 - <td>  
34 - <a-tag color="purple">jvm.memory.used</a-tag>  
35 - </td>  
36 - <td>JVM 已用内存</td>  
37 - <td>{{jvm.memory.used}} MB</td>  
38 - </tr>  
39 - <tr>  
40 - <td>  
41 - <a-tag color="cyan">jvm.buffer.memory.used</a-tag>  
42 - </td>  
43 - <td>JVM 缓冲区已用内存</td>  
44 - <td>{{jvm.buffer.memory.used}} MB</td>  
45 - </tr>  
46 - <tr>  
47 - <td>  
48 - <a-tag color="cyan">jvm.buffer.count</a-tag>  
49 - </td>  
50 - <td>当前缓冲区数量</td>  
51 - <td>{{jvm.buffer.count}} 个</td>  
52 - </tr>  
53 - <tr>  
54 - <td>  
55 - <a-tag color="green">jvm.threads.daemon</a-tag>  
56 - </td>  
57 - <td>JVM 守护线程数量</td>  
58 - <td>{{jvm.threads.daemon}} 个</td>  
59 - </tr>  
60 - <tr>  
61 - <td>  
62 - <a-tag color="green">jvm.threads.live</a-tag>  
63 - </td>  
64 - <td>JVM 当前活跃线程数量</td>  
65 - <td>{{jvm.threads.live}} 个</td>  
66 - </tr>  
67 - <tr>  
68 - <td>  
69 - <a-tag color="green">jvm.threads.peak</a-tag>  
70 - </td>  
71 - <td>JVM 峰值线程数量</td>  
72 - <td>{{jvm.threads.peak}} 个</td>  
73 - </tr>  
74 - <tr>  
75 - <td>  
76 - <a-tag color="orange">jvm.classes.loaded</a-tag>  
77 - </td>  
78 - <td>JVM 已加载 Class 数量</td>  
79 - <td>{{jvm.classes.loaded}} 个</td>  
80 - </tr>  
81 - <tr>  
82 - <td>  
83 - <a-tag color="orange">jvm.classes.unloaded</a-tag>  
84 - </td>  
85 - <td>JVM 未加载 Class 数量</td>  
86 - <td>{{jvm.classes.unloaded}} 个</td>  
87 - </tr>  
88 - <tr>  
89 - <td>  
90 - <a-tag color="pink">jvm.gc.memory.allocated</a-tag>  
91 - </td>  
92 - <td>GC 时, 年轻代分配的内存空间</td>  
93 - <td>{{jvm.gc.memory.allocated}} MB</td>  
94 - </tr>  
95 - <tr>  
96 - <td>  
97 - <a-tag color="pink">jvm.gc.memory.promoted</a-tag>  
98 - </td>  
99 - <td>GC 时, 老年代分配的内存空间</td>  
100 - <td>{{jvm.gc.memory.promoted}} MB</td>  
101 - </tr>  
102 - <tr>  
103 - <td>  
104 - <a-tag color="pink">jvm.gc.max.data.size</a-tag>  
105 - </td>  
106 - <td>GC 时, 老年代的最大内存空间</td>  
107 - <td>{{jvm.gc.maxDataSize}} MB</td>  
108 - </tr>  
109 - <tr>  
110 - <td>  
111 - <a-tag color="pink">jvm.gc.live.data.size</a-tag>  
112 - </td>  
113 - <td>FullGC 时, 老年代的内存空间</td>  
114 - <td>{{jvm.gc.liveDataSize}} MB</td>  
115 - </tr>  
116 - <tr>  
117 - <td>  
118 - <a-tag color="blue">jvm.gc.pause.count</a-tag>  
119 - </td>  
120 - <td>系统启动以来GC 次数</td>  
121 - <td>{{jvm.gc.pause.count}} 次</td>  
122 - </tr>  
123 - <tr>  
124 - <td>  
125 - <a-tag color="blue">jvm.gc.pause.totalTime</a-tag>  
126 - </td>  
127 - <td>系统启动以来GC 总耗时</td>  
128 - <td>{{jvm.gc.pause.totalTime}} 秒</td>  
129 - </tr>  
130 - </table>  
131 - </div>  
132 - </a-skeleton>  
133 -</template>  
134 -<script>  
135 - import axios from 'axios'  
136 - import moment from 'moment'  
137 - import {getAction} from '@/api/manage'  
138 - moment.locale('zh-cn')  
139 -  
140 - export default {  
141 - data() {  
142 - return {  
143 - time: '',  
144 - loading: true,  
145 - jvm: {  
146 - memory: {  
147 - max: 0,  
148 - committed: 0,  
149 - used: 0  
150 - },  
151 - buffer: {  
152 - memory: {  
153 - used: 0  
154 - },  
155 - count: 0  
156 - },  
157 - threads: {  
158 - daemon: 0,  
159 - live: 0,  
160 - peak: 0  
161 - },  
162 - classes: {  
163 - loaded: 0,  
164 - unloaded: 0  
165 - },  
166 - gc: {  
167 - memory: {  
168 - allocated: 0,  
169 - promoted: 0  
170 - },  
171 - maxDataSize: 0,  
172 - liveDataSize: 0,  
173 - pause: {  
174 - totalTime: 0,  
175 - count: 0  
176 - }  
177 - }  
178 - }  
179 - }  
180 - },  
181 - mounted() {  
182 - this.create()  
183 - },  
184 - methods: {  
185 - create() {  
186 - this.time = moment().format('YYYY年MM月DD日 HH时mm分ss秒')  
187 - axios.all([  
188 - getAction('actuator/metrics/jvm.memory.max'),  
189 - getAction('actuator/metrics/jvm.memory.committed'),  
190 - getAction('actuator/metrics/jvm.memory.used'),  
191 - getAction('actuator/metrics/jvm.buffer.memory.used'),  
192 - getAction('actuator/metrics/jvm.buffer.count'),  
193 - getAction('actuator/metrics/jvm.threads.daemon'),  
194 - getAction('actuator/metrics/jvm.threads.live'),  
195 - getAction('actuator/metrics/jvm.threads.peak'),  
196 - getAction('actuator/metrics/jvm.classes.loaded'),  
197 - getAction('actuator/metrics/jvm.classes.unloaded'),  
198 - getAction('actuator/metrics/jvm.gc.memory.allocated'),  
199 - getAction('actuator/metrics/jvm.gc.memory.promoted'),  
200 - getAction('actuator/metrics/jvm.gc.max.data.size'),  
201 - getAction('actuator/metrics/jvm.gc.live.data.size'),  
202 - getAction('actuator/metrics/jvm.gc.pause')  
203 - ]).then((r) => {  
204 - this.jvm.memory.max = this.convert(r[0].measurements[0].value)  
205 - this.jvm.memory.committed = this.convert(r[1].measurements[0].value)  
206 - this.jvm.memory.used = this.convert(r[2].measurements[0].value)  
207 - this.jvm.buffer.memory.used = this.convert(r[3].measurements[0].value)  
208 - this.jvm.buffer.count = r[4].measurements[0].value  
209 - this.jvm.threads.daemon = r[5].measurements[0].value  
210 - this.jvm.threads.live = r[6].measurements[0].value  
211 - this.jvm.threads.peak = r[7].measurements[0].value  
212 - this.jvm.classes.loaded = r[8].measurements[0].value  
213 - this.jvm.classes.unloaded = r[9].measurements[0].value  
214 - this.jvm.gc.memory.allocated = this.convert(r[10].measurements[0].value)  
215 - this.jvm.gc.memory.promoted = this.convert(r[11].measurements[0].value)  
216 - this.jvm.gc.maxDataSize = this.convert(r[12].measurements[0].value)  
217 - this.jvm.gc.liveDataSize = this.convert(r[13].measurements[0].value)  
218 - this.jvm.gc.pause.count = r[14].measurements[0].value  
219 - this.jvm.gc.pause.totalTime = r[14].measurements[1].value  
220 - this.loading = false  
221 - }).catch((r) => {  
222 - console.error(r)  
223 - this.$message.error('获取JVM信息失败')  
224 - })  
225 - },  
226 - convert(value) {  
227 - return Number(value / 1048576).toFixed(3)  
228 - }  
229 - }  
230 - }  
231 -</script>  
232 -<style lang="less">  
233 - .jvm-info {  
234 - width: 100%;  
235 - table {  
236 - width: 100%;  
237 - tr {  
238 - line-height: 1.5rem;  
239 - border-bottom: 1px solid #f1f1f1;  
240 - th {  
241 - background: #fafafa;  
242 - padding: .5rem;  
243 - }  
244 - td {  
245 - padding: .5rem;  
246 - .ant-tag {  
247 - font-size: .8rem !important;  
248 - }  
249 - }  
250 - }  
251 - }  
252 - .alert {  
253 - margin-bottom: .5rem;  
254 - }  
255 - }  
256 -</style>  
ant-design-jeecg-vue/src/views/monitor/RedisInfo.vue deleted
1 -<template>  
2 - <div style="width: 100%;margin-top: 1rem;background-color: #ffffff">  
3 - <a-row :gutter="8">  
4 - <a-col :span="12">  
5 - <apexchart ref="memoryInfo" type=area height=350 :options="memory.chartOptions" :series="memory.series" />  
6 - </a-col>  
7 - <a-col :span="12">  
8 - <apexchart ref="keySize" type=area height=350 :options="key.chartOptions" :series="key.series" />  
9 - </a-col>  
10 - </a-row>  
11 - <a-row :gutter="8">  
12 - <a-divider orientation="left">Redis详细信息</a-divider>  
13 - <table style="border-bottom: 1px solid #f1f1f1;">  
14 - <tr v-for="(info, index) in redisInfo" :key="index" style="border-top: 1px solid #f1f1f1;">  
15 - <td style="padding: .7rem 1rem">{{info.key}}</td>  
16 - <td style="padding: .7rem 1rem">{{info.description}}</td>  
17 - <td style="padding: .7rem 1rem">{{info.value}}</td>  
18 - </tr>  
19 - </table>  
20 - </a-row>  
21 - </div>  
22 -</template>  
23 -<script>  
24 -import axios from 'axios'  
25 -import moment from 'moment'  
26 -import {getAction} from '@/api/manage'  
27 -  
28 -export default {  
29 - name: 'RedisInfo',  
30 - data () {  
31 - return {  
32 - loading: true,  
33 - memory: {  
34 - series: [],  
35 - chartOptions: {  
36 - chart: {  
37 - animations: {  
38 - enabled: true,  
39 - easing: 'linear',  
40 - dynamicAnimation: {  
41 - speed: 3000  
42 - }  
43 - },  
44 - toolbar: {  
45 - show: false  
46 - },  
47 - zoom: {  
48 - enabled: false  
49 - }  
50 - },  
51 - dataLabels: {  
52 - enabled: false  
53 - },  
54 - stroke: {  
55 - curve: 'smooth'  
56 - },  
57 - title: {  
58 - text: 'Redis内存实时占用情况(kb)',  
59 - align: 'left'  
60 - },  
61 - markers: {  
62 - size: 0  
63 - },  
64 - xaxis: {  
65 - },  
66 - yaxis: {},  
67 - legend: {  
68 - show: false  
69 - }  
70 - },  
71 - data: [],  
72 - xdata: []  
73 - },  
74 - key: {  
75 - series: [],  
76 - chartOptions: {  
77 - chart: {  
78 - animations: {  
79 - enabled: true,  
80 - easing: 'linear',  
81 - dynamicAnimation: {  
82 - speed: 3000  
83 - }  
84 - },  
85 - toolbar: {  
86 - show: false  
87 - },  
88 - zoom: {  
89 - enabled: false  
90 - }  
91 - },  
92 - dataLabels: {  
93 - enabled: false  
94 - },  
95 - colors: ['#f5564e'],  
96 - stroke: {  
97 - curve: 'smooth'  
98 - },  
99 - title: {  
100 - text: 'Redis key实时数量(个)',  
101 - align: 'left'  
102 - },  
103 - markers: {  
104 - size: 0  
105 - },  
106 - xaxis: {  
107 - },  
108 - yaxis: {},  
109 - legend: {  
110 - show: false  
111 - }  
112 - },  
113 - data: [],  
114 - xdata: []  
115 - },  
116 - redisInfo: [],  
117 - timer: null  
118 - }  
119 - },  
120 - beforeDestroy () {  
121 - if (this.timer) {  
122 - clearInterval(this.timer)  
123 - }  
124 - },  
125 - mounted () {  
126 - let minMemory = 1e10  
127 - let minSize = 1e10  
128 - let maxMemory = -1e10  
129 - let maxSize = -1e10  
130 - this.timer = setInterval(() => {  
131 - if (this.$route.path.indexOf('redis') !== -1) {  
132 - axios.all([  
133 - getAction('redis/keysSize'),  
134 - getAction('redis/memoryInfo')  
135 - ]).then((r) => {  
136 - console.log(r)  
137 - let currentMemory = r[1].used_memory / 1000  
138 - let currentSize = r[0].dbSize  
139 - if (currentMemory < minMemory) {  
140 - minMemory = currentMemory  
141 - }  
142 - if (currentMemory > maxMemory) {  
143 - maxMemory = currentMemory  
144 - }  
145 - if (currentSize < minSize) {  
146 - minSize = currentSize  
147 - }  
148 - if (currentSize > maxSize) {  
149 - maxSize = currentSize  
150 - }  
151 - let time = moment().format('hh:mm:ss')  
152 - this.memory.data.push(currentMemory)  
153 - this.memory.xdata.push(time)  
154 - this.key.data.push(currentSize)  
155 - this.key.xdata.push(time)  
156 - if (this.memory.data.length >= 6) {  
157 - this.memory.data.shift()  
158 - this.memory.xdata.shift()  
159 - }  
160 - if (this.key.data.length >= 6) {  
161 - this.key.data.shift()  
162 - this.key.xdata.shift()  
163 - }  
164 - this.$refs.memoryInfo.updateSeries([  
165 - {  
166 - name: '内存(kb)',  
167 - data: this.memory.data.slice()  
168 - }  
169 - ])  
170 - this.$refs.memoryInfo.updateOptions({  
171 - xaxis: {  
172 - categories: this.memory.xdata.slice()  
173 - },  
174 - yaxis: {  
175 - min: minMemory,  
176 - max: maxMemory  
177 - }  
178 - }, true, true)  
179 - this.$refs.keySize.updateSeries([  
180 - {  
181 - name: 'key数量',  
182 - data: this.key.data.slice()  
183 - }  
184 - ])  
185 - this.$refs.keySize.updateOptions({  
186 - xaxis: {  
187 - categories: this.key.xdata.slice()  
188 - },  
189 - yaxis: {  
190 - min: minSize - 2,  
191 - max: maxSize + 2  
192 - }  
193 - }, true, true)  
194 - if (this.loading) {  
195 - this.loading = false  
196 - }  
197 - }).catch((r) => {  
198 - console.error(r)  
199 - this.$message.error('获取Redis信息失败')  
200 - if (this.timer) {  
201 - clearInterval(this.timer)  
202 - }  
203 - })  
204 - }  
205 - }, 3000)  
206 - getAction('redis/info').then((r) => {  
207 - console.log('redis/info')  
208 - console.log(r)  
209 - this.redisInfo = r.result  
210 - })  
211 - }  
212 -}  
213 -</script>  
214 -<style>  
215 -  
216 -</style>  
ant-design-jeecg-vue/src/views/monitor/RedisTerminal.vue deleted
1 -<template>  
2 - <div>  
3 - <div>Redis终端</div>  
4 - </div>  
5 -</template>  
6 -<script>  
7 -export default {  
8 - name: 'RedisTerminal'  
9 -}  
10 -</script>  
11 -<style>  
12 -  
13 -</style>  
ant-design-jeecg-vue/src/views/monitor/SystemInfo.vue deleted
1 -<template>  
2 - <a-skeleton active :loading="loading" :paragraph="{rows: 17}">  
3 - <div class="jvm-info" style="background-color: #ffffff">  
4 - <div class="alert">  
5 - <a-alert type="success" :show-icon="true">  
6 - <div slot="message">  
7 - 数据获取时间 {{this.time}}  
8 - <a style="margin-left: 24px" @click="create">点击刷新</a>  
9 - </div>  
10 - </a-alert>  
11 - </div>  
12 - <table>  
13 - <tr>  
14 - <th>参数</th>  
15 - <th>描述</th>  
16 - <th>当前值</th>  
17 - </tr>  
18 - <tr>  
19 - <td><a-tag color="green">system.cpu.count</a-tag></td>  
20 - <td>CPU 数量</td>  
21 - <td>{{system.cpu.count}} 核</td>  
22 - </tr>  
23 - <tr>  
24 - <td><a-tag color="green">system.cpu.usage</a-tag></td>  
25 - <td>系统 CPU 使用率</td>  
26 - <td>{{system.cpu.usage}} %</td>  
27 - </tr>  
28 - <tr>  
29 - <td><a-tag color="purple">process.start.time</a-tag></td>  
30 - <td>应用启动时间点</td>  
31 - <td>{{system.process.startTime}}</td>  
32 - </tr>  
33 - <tr>  
34 - <td><a-tag color="purple">process.uptime</a-tag></td>  
35 - <td>应用已运行时间</td>  
36 - <td>{{system.process.uptime}} 秒</td>  
37 - </tr>  
38 - <tr>  
39 - <td><a-tag color="purple">process.cpu.usage</a-tag></td>  
40 - <td>当前应用 CPU 使用率</td>  
41 - <td>{{system.process.cpuUsage}} %</td>  
42 - </tr>  
43 - </table>  
44 - </div>  
45 - </a-skeleton>  
46 -</template>  
47 -<script>  
48 -import axios from 'axios'  
49 -import moment from 'moment'  
50 -import {getAction} from '@/api/manage'  
51 -moment.locale('zh-cn')  
52 -  
53 -export default {  
54 - data () {  
55 - return {  
56 - time: '',  
57 - loading: true,  
58 - system: {  
59 - cpu: {  
60 - count: 0,  
61 - usage: 0  
62 - },  
63 - process: {  
64 - cpuUsage: 0,  
65 - uptime: 0,  
66 - startTime: 0  
67 - }  
68 - }  
69 - }  
70 - },  
71 - mounted () {  
72 - this.create()  
73 - },  
74 - methods: {  
75 - create () {  
76 - this.time = moment().format('YYYY年MM月DD日 HH时mm分ss秒')  
77 - axios.all([  
78 - getAction('actuator/metrics/system.cpu.count'),  
79 - getAction('actuator/metrics/system.cpu.usage'),  
80 - getAction('actuator/metrics/process.uptime'),  
81 - getAction('actuator/metrics/process.start.time'),  
82 - getAction('actuator/metrics/process.cpu.usage')  
83 - ]).then((r) => {  
84 - this.system.cpu.count = r[0].measurements[0].value  
85 - this.system.cpu.usage = this.convert(r[1].measurements[0].value)  
86 - this.system.process.uptime = r[2].measurements[0].value  
87 - this.system.process.startTime = moment(r[3].measurements[0].value * 1000).format('YYYY-MM-DD HH:mm:ss')  
88 - this.system.process.cpuUsage = this.convert(r[4].measurements[0].value)  
89 - this.loading = false  
90 - }).catch((r) => {  
91 - console.error(r)  
92 - this.$message.error('获取服务器信息失败')  
93 - })  
94 - },  
95 - convert (value) {  
96 - return Number(value * 100).toFixed(2)  
97 - }  
98 - }  
99 -}  
100 -</script>  
101 -<style lang="less">  
102 - .jvm-info {  
103 - width: 100%;  
104 - table {  
105 - width: 100%;  
106 - tr {  
107 - line-height: 1.5rem;  
108 - border-bottom: 1px solid #f1f1f1;  
109 - th {  
110 - background: #fafafa;  
111 - padding: .5rem;  
112 - }  
113 - td {  
114 - padding: .5rem;  
115 - .ant-tag {  
116 - font-size: .8rem !important;  
117 - }  
118 - }  
119 - }  
120 - }  
121 - .alert {  
122 - margin-bottom: .5rem;  
123 - }  
124 - }  
125 -</style>  
ant-design-jeecg-vue/src/views/monitor/TomcatInfo.vue deleted
1 -<template>  
2 - <a-skeleton active :loading="loading" :paragraph="{rows: 17}">  
3 - <div class="jvm-info" style="background-color: #ffffff">  
4 - <div class="alert">  
5 - <a-alert type="success" :show-icon="true">  
6 - <div slot="message">  
7 - 数据获取时间 {{this.time}}  
8 - <a style="margin-left: 24px" @click="create">点击刷新</a>  
9 - </div>  
10 - </a-alert>  
11 - </div>  
12 - <table>  
13 - <tr>  
14 - <th>参数</th>  
15 - <th>描述</th>  
16 - <th>当前值</th>  
17 - </tr>  
18 - <tr>  
19 - <td><a-tag color="green">tomcat.sessions.created</a-tag></td>  
20 - <td>tomcat 已创建 session 数</td>  
21 - <td>{{tomcat.sessions.created}} 个</td>  
22 - </tr>  
23 - <tr>  
24 - <td><a-tag color="green">tomcat.sessions.expired</a-tag></td>  
25 - <td>tomcat 已过期 session 数</td>  
26 - <td>{{tomcat.sessions.expired}} 个</td>  
27 - </tr>  
28 - <tr>  
29 - <td><a-tag color="green">tomcat.sessions.active.current</a-tag></td>  
30 - <td>tomcat 当前活跃 session 数</td>  
31 - <td>{{tomcat.sessions.active.current}} 个</td>  
32 - </tr>  
33 - <tr>  
34 - <td><a-tag color="green">tomcat.sessions.active.max</a-tag></td>  
35 - <td>tomcat 活跃 session 数峰值</td>  
36 - <td>{{tomcat.sessions.active.max}} 个</td>  
37 - </tr>  
38 - <tr>  
39 - <td><a-tag color="green">tomcat.sessions.rejected</a-tag></td>  
40 - <td>超过session 最大配置后,拒绝的 session 个数</td>  
41 - <td>{{tomcat.sessions.rejected}} 个</td>  
42 - </tr>  
43 - <tr>  
44 - <td><a-tag color="purple">tomcat.global.sent</a-tag></td>  
45 - <td>发送的字节数</td>  
46 - <td>{{tomcat.global.sent}} bytes</td>  
47 - </tr>  
48 - <tr>  
49 - <td><a-tag color="purple">tomcat.global.request.max</a-tag></td>  
50 - <td>request 请求最长耗时</td>  
51 - <td>{{tomcat.global.request.max}} 秒</td>  
52 - </tr>  
53 - <tr>  
54 - <td><a-tag color="purple">tomcat.global.request.count</a-tag></td>  
55 - <td>全局 request 请求次数</td>  
56 - <td>{{tomcat.global.request.count}} 次</td>  
57 - </tr>  
58 - <tr>  
59 - <td><a-tag color="purple">tomcat.global.request.totalTime</a-tag></td>  
60 - <td>全局 request 请求总耗时</td>  
61 - <td>{{tomcat.global.request.totalTime}} 秒</td>  
62 - </tr>  
63 - <tr>  
64 - <td><a-tag color="cyan">tomcat.servlet.request.max</a-tag></td>  
65 - <td>servlet 请求最长耗时</td>  
66 - <td>{{tomcat.servlet.request.max}} 秒</td>  
67 - </tr>  
68 - <tr>  
69 - <td><a-tag color="cyan">tomcat.servlet.request.count</a-tag></td>  
70 - <td>servlet 总请求次数</td>  
71 - <td>{{tomcat.servlet.request.count}} 次</td>  
72 - </tr>  
73 - <tr>  
74 - <td><a-tag color="cyan">tomcat.servlet.request.totalTime</a-tag></td>  
75 - <td>servlet 请求总耗时</td>  
76 - <td>{{tomcat.servlet.request.totalTime}} 秒</td>  
77 - </tr>  
78 - <tr>  
79 - <td><a-tag color="pink">tomcat.threads.current</a-tag></td>  
80 - <td>tomcat 当前线程数(包括守护线程)</td>  
81 - <td>{{tomcat.threads.current}} 个</td>  
82 - </tr>  
83 - <tr>  
84 - <td><a-tag color="pink">tomcat.threads.configMax</a-tag></td>  
85 - <td>tomcat 配置的线程最大数</td>  
86 - <td>{{tomcat.threads.configMax}} 个</td>  
87 - </tr>  
88 - </table>  
89 - </div>  
90 - </a-skeleton>  
91 -</template>  
92 -<script>  
93 -import axios from 'axios'  
94 -import moment from 'moment'  
95 -import {getAction} from '@/api/manage'  
96 -moment.locale('zh-cn')  
97 -  
98 -export default {  
99 - data () {  
100 - return {  
101 - time: '',  
102 - loading: true,  
103 - tomcat: {  
104 - sessions: {  
105 - created: 0,  
106 - expired: 0,  
107 - active: {  
108 - current: 0,  
109 - max: 0  
110 - },  
111 - rejected: 0  
112 - },  
113 - global: {  
114 - sent: 0,  
115 - request: {  
116 - count: 0,  
117 - max: 0,  
118 - totalTime: 0  
119 - }  
120 - },  
121 - servlet: {  
122 - request: {  
123 - count: 0,  
124 - totalTime: 0,  
125 - max: 0  
126 - }  
127 - },  
128 - threads: {  
129 - current: 0,  
130 - configMax: 0  
131 - }  
132 - }  
133 - }  
134 - },  
135 - mounted () {  
136 - this.create()  
137 - },  
138 - methods: {  
139 - create () {  
140 - this.time = moment().format('YYYY年MM月DD日 HH时mm分ss秒')  
141 - axios.all([  
142 - getAction('actuator/metrics/tomcat.sessions.created'),  
143 - getAction('actuator/metrics/tomcat.sessions.expired'),  
144 - getAction('actuator/metrics/tomcat.sessions.active.current'),  
145 - getAction('actuator/metrics/tomcat.sessions.active.max'),  
146 - getAction('actuator/metrics/tomcat.sessions.rejected'),  
147 - getAction('actuator/metrics/tomcat.global.sent'),  
148 - getAction('actuator/metrics/tomcat.global.request.max'),  
149 - getAction('actuator/metrics/tomcat.global.request'),  
150 - getAction('actuator/metrics/tomcat.servlet.request'),  
151 - getAction('actuator/metrics/tomcat.servlet.request.max'),  
152 - getAction('actuator/metrics/tomcat.threads.current'),  
153 - getAction('actuator/metrics/tomcat.threads.config.max')  
154 - ]).then((r) => {  
155 - this.tomcat.sessions.created = r[0].measurements[0].value  
156 - this.tomcat.sessions.expired = r[1].measurements[0].value  
157 - this.tomcat.sessions.active.current = r[2].measurements[0].value  
158 - this.tomcat.sessions.active.max = r[3].measurements[0].value  
159 - this.tomcat.sessions.rejected = r[4].measurements[0].value  
160 - this.tomcat.global.sent = r[5].measurements[0].value  
161 - this.tomcat.global.request.max = r[6].measurements[0].value  
162 - this.tomcat.global.request.count = r[7].measurements[0].value  
163 - this.tomcat.global.request.totalTime = r[7].measurements[1].value  
164 - this.tomcat.servlet.request.count = r[8].measurements[0].value  
165 - this.tomcat.servlet.request.totalTime = r[8].measurements[1].value  
166 - this.tomcat.servlet.request.max = r[9].measurements[0].value  
167 - this.tomcat.threads.current = r[10].measurements[0].value  
168 - this.tomcat.threads.configMax = r[11].measurements[0].value  
169 - this.loading = false  
170 - }).catch((r) => {  
171 - console.error(r)  
172 - this.$message.error('获取Tomcat信息失败')  
173 - })  
174 - }  
175 - }  
176 -}  
177 -</script>  
178 -<style lang="less">  
179 - .jvm-info {  
180 - width: 100%;  
181 - table {  
182 - width: 100%;  
183 - tr {  
184 - line-height: 1.5rem;  
185 - border-bottom: 1px solid #f1f1f1;  
186 - th {  
187 - background: #fafafa;  
188 - padding: .5rem;  
189 - }  
190 - td {  
191 - padding: .5rem;  
192 - .ant-tag {  
193 - font-size: .8rem !important;  
194 - }  
195 - }  
196 - }  
197 - }  
198 - .alert {  
199 - margin-bottom: .5rem;  
200 - }  
201 - }  
202 -</style>  
jeecg-boot/docs/db/jeecg-boot_1.1.0-20190415.sql
@@ -2391,4 +2391,5 @@ INSERT INTO `sys_user_role` VALUES (&#39;fe38580871c5061ba59d5c03a0840b0e&#39;, &#39;a75d45a @@ -2391,4 +2391,5 @@ INSERT INTO `sys_user_role` VALUES (&#39;fe38580871c5061ba59d5c03a0840b0e&#39;, &#39;a75d45a
2391 INSERT INTO `sys_user_role` VALUES ('6ec01b4aaab790eac4ddb33d7a524a58', 'e9ca23d68d884d4ebb19d07889727dae', 'f6817f48af4fb3af11b9e8bf182f618b'); 2391 INSERT INTO `sys_user_role` VALUES ('6ec01b4aaab790eac4ddb33d7a524a58', 'e9ca23d68d884d4ebb19d07889727dae', 'f6817f48af4fb3af11b9e8bf182f618b');
2392 INSERT INTO `sys_user_role` VALUES ('d2233e5be091d39da5abb0073c766224', 'f0019fdebedb443c98dcb17d88222c38', 'ee8626f80f7c2619917b6236f3a7f02b'); 2392 INSERT INTO `sys_user_role` VALUES ('d2233e5be091d39da5abb0073c766224', 'f0019fdebedb443c98dcb17d88222c38', 'ee8626f80f7c2619917b6236f3a7f02b');
2393 2393
2394 -UPDATE `sys_permission` SET `component`='/jeecg/PrintDemo' WHERE (`id`='e6bfd1fcabfd7942fdd05f076d1dad38');  
2395 \ No newline at end of file 2394 \ No newline at end of file
  2395 +UPDATE `sys_permission` SET `component`='/jeecg/PrintDemo' WHERE (`id`='e6bfd1fcabfd7942fdd05f076d1dad38');
  2396 +delete from sys_permission where id = '700b7f95165c46cc7a78bf227aa8fed3'
2396 \ No newline at end of file 2397 \ No newline at end of file