1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 16:29:17 +08:00

fix: 优化 Redis 状态显示 (#3578)

Refs #3576
This commit is contained in:
ssongliu 2024-01-11 16:18:50 +08:00 committed by GitHub
parent cb85860ff6
commit ad4aac51d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 6 deletions

View File

@ -483,8 +483,9 @@ const message = {
tcpPort: 'Current listening port', tcpPort: 'Current listening port',
uptimeInDays: 'Days in operation', uptimeInDays: 'Days in operation',
connectedClients: 'Number of connected clients', connectedClients: 'Number of connected clients',
usedMemory: 'Redis indicates the peak value of memory allocated historically', usedMemory: 'Current memory usage of Redis',
usedMemoryRss: 'Total system memory used by Redis', usedMemoryRss: 'Memory size requested from the operating system',
usedMemoryPeak: 'Peak memory consumption of Redis',
memFragmentationRatio: 'Memory fragmentation ratio', memFragmentationRatio: 'Memory fragmentation ratio',
totalConnectionsReceived: 'Total number of clients connected since run', totalConnectionsReceived: 'Total number of clients connected since run',
totalCommandsProcessed: 'The total number of commands executed since the run', totalCommandsProcessed: 'The total number of commands executed since the run',

View File

@ -471,8 +471,9 @@ const message = {
tcpPort: '當前監聽端口', tcpPort: '當前監聽端口',
uptimeInDays: '已運行天數', uptimeInDays: '已運行天數',
connectedClients: '連接的客戶端數量', connectedClients: '連接的客戶端數量',
usedMemory: 'Redis 歷史分配內存的峰值', usedMemory: '當前 Redis 使用的內存大小',
usedMemoryRss: 'Redis 當前占用的系統內存總量', usedMemoryRss: '向操作系统申請的內存大小',
usedMemoryPeak: 'Redis 的內存消耗峰值',
memFragmentationRatio: '內存碎片比率', memFragmentationRatio: '內存碎片比率',
totalConnectionsReceived: '運行以來連接過的客戶端的總數量', totalConnectionsReceived: '運行以來連接過的客戶端的總數量',
totalCommandsProcessed: '運行以來執行過的命令的總數量', totalCommandsProcessed: '運行以來執行過的命令的總數量',

View File

@ -471,8 +471,9 @@ const message = {
tcpPort: '当前监听端口', tcpPort: '当前监听端口',
uptimeInDays: '已运行天数', uptimeInDays: '已运行天数',
connectedClients: '连接的客户端数量', connectedClients: '连接的客户端数量',
usedMemory: 'Redis 历史分配内存的峰值', usedMemory: '当前 Redis 使用的内存大小',
usedMemoryRss: 'Redis 当前占用的系统内存总量', usedMemoryRss: '向操作系统申请的内存大小',
usedMemoryPeak: 'Redis 的内存消耗峰值',
memFragmentationRatio: '内存碎片比率', memFragmentationRatio: '内存碎片比率',
totalConnectionsReceived: '运行以来连接过的客户端的总数量', totalConnectionsReceived: '运行以来连接过的客户端的总数量',
totalCommandsProcessed: '运行以来执行过的命令的总数量', totalCommandsProcessed: '运行以来执行过的命令的总数量',

View File

@ -54,6 +54,15 @@
<span class="input-help">{{ $t('database.usedMemory') }}</span> <span class="input-help">{{ $t('database.usedMemory') }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6">
<el-form-item>
<template #label>
<span class="status-label">used_memory_peak</span>
</template>
<span class="status-count">{{ redisStatus.used_memory_peak }}</span>
<span class="input-help">{{ $t('database.usedMemoryPeak') }}</span>
</el-form-item>
</el-col>
<el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6"> <el-col :xs="12" :sm="12" :md="6" :lg="6" :xl="6">
<el-form-item> <el-form-item>
<template #label> <template #label>
@ -175,6 +184,7 @@ const loadStatus = async () => {
redisStatus.tcp_port = res.data.tcp_port; redisStatus.tcp_port = res.data.tcp_port;
redisStatus.connected_clients = res.data.connected_clients; redisStatus.connected_clients = res.data.connected_clients;
redisStatus.used_memory_rss = (Number(res.data.used_memory_rss) / 1024 / 1024).toFixed(2) + ' MB'; redisStatus.used_memory_rss = (Number(res.data.used_memory_rss) / 1024 / 1024).toFixed(2) + ' MB';
redisStatus.used_memory_peak = (Number(res.data.used_memory_peak) / 1024 / 1024).toFixed(2) + ' MB';
redisStatus.used_memory = (Number(res.data.used_memory) / 1024 / 1024).toFixed(2) + ' MB'; redisStatus.used_memory = (Number(res.data.used_memory) / 1024 / 1024).toFixed(2) + ' MB';
redisStatus.mem_fragmentation_ratio = res.data.mem_fragmentation_ratio; redisStatus.mem_fragmentation_ratio = res.data.mem_fragmentation_ratio;
redisStatus.total_connections_received = res.data.total_connections_received; redisStatus.total_connections_received = res.data.total_connections_received;