Skip to content

Commit

Permalink
fix: some issues in 1230 iteration (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
xigongdaEricyang authored Jan 9, 2023
1 parent d6afe0a commit decbb98
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nebula-dashboard",
"version": "3.2.0",
"version": "3.3.0",
"description": "nebula-dashboard community version",
"author": "vesoft cloud team",
"nebulaVersion": "3.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/DashboardCard/LineCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, { useEffect, useMemo, useRef } from 'react';
import _ from 'lodash';
import { Spin } from 'antd';
import LineChart from '@/components/Charts/LineChart';
import { ILineChartMetric, IStatSingleItem, ServiceName } from '@/utils/interface';
import { ILineChartMetric } from '@/utils/interface';
import { VALUE_TYPE } from '@/utils/promQL';
import { getMaxNum, getMaxNumAndLength, getMinNum, getProperStep, getTickIntervalByGap } from '@/utils/dashboard';
import { getMaxNum, getMaxNumAndLength, getMinNum, getTickIntervalByGap } from '@/utils/dashboard';

interface IProps {
data: ILineChartMetric[];
Expand Down
8 changes: 6 additions & 2 deletions src/config/locale/en-US/metric_description.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
"cpu_user": "The percentage of CPU used by users",
"cpu_system": "The percentage of CPU used by the system",
"memory_utilization": "The percentage of used memory",
"memory_used": "The memory space used (including caches)",
"memory_actual_used": "The memory space used (not including caches)",
"memory_used": "The memory space used (including cache and buffer)",
"memory_used_percentage": "The percentage of used memory(including cache and buffer)",
"memory_actual_used": "The memory space used (not including cache and buffer)",
"memory_actual_used_percentage": "The percentage of used memory (not including cache and buffer)",
"memory_free": "The memory space available",
"memory_swap_total": "The total memory space of the swap",
"root_fs_used_percentage": "The percentage of used disk space of the root file system",
"load_1m": "The average load of the system in the last 1 minute",
"load_5m": "The average load of the system in the last 5 minutes",
"load_15m": "The average load of the system in the last 15 minutes",
Expand Down
4 changes: 2 additions & 2 deletions src/config/locale/zh-CN/description.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"partitionDistribution": "分片分布",
"leaderDistribution": "Leader 分布",
"partitionId": "分片序号",
"leader": "分片的Leader的IP地址和端口",
"leader": "分片Leader的IP地址和端口号",
"peers": "分片所有副本的IP地址和端口",
"losts": "分片的故障离线副本的IP地址和端口",
"losts": "分片出现故障离线副本的IP地址和端口",
"jobId": "第一行显示作业ID,其他行显示作业相关的任务ID。",
"command": "第一行显示执行的作业命令名称,其他行显示任务对应的Nebula Storaged进程。",
"longTermStatus": "显示作业或任务的状态。",
Expand Down
19 changes: 12 additions & 7 deletions src/config/locale/zh-CN/metric_description.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
"cpu_utilization": "CPU已使用百分比",
"cpu_idle": "CPU空闲百分比",
"cpu_wait": "等待IO操作的CPU百分比",
"cpu_user": "用户空间(非NebulaGraph图空间)占用的CPU百分比",
"cpu_system": "内核空间(非NebulaGraph内核空间)占用的CPU百分比",
"memory_utilization": "内存已使用百分比",
"memory_used": "已使用内存(包括缓存)",
"memory_actual_used": "实际使用内存(不包括缓存)",
"cpu_idle": "CPU总空闲百分比",
"cpu_wait": "等待IO操作使用的CPU百分比",
"cpu_user": "用户空间占用的CPU百分比",
"cpu_system": "系统空间占用的CPU百分比",
"memory_used": "已使用内存(包括Buffer缓存和Cached缓存)",
"memory_used_percentage": "已使用内存百分比(包括Buffer缓存和Cached缓存)",
"memory_actual_used": "实际使用内存(不包括Buffer缓存和Cached缓存)",
"memory_actual_used_percentage": "实际使用内存百分比(不包括Buffer缓存和Cached缓存)",
"memory_free": "空闲内存",
"memory_swap_total": "SWAP 交换分区的大小",
"root_fs_used_percentage": "根文件系统磁盘使用率",
"memory_cached_buffer_used": "已使用的Buffer缓存和Cached缓存大小",
"memory_cached_buffer_used_percentage": "已使用的Buffer缓存和Cached缓存百分比",
"load_1m": "最近1分钟系统平均负载",
"load_5m": "最近5分钟系统平均负载",
"load_15m": "最近15分钟系统平均负载",
Expand Down
3 changes: 1 addition & 2 deletions src/pages/ServiceDashboard/ServiceOverview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class ServiceOverview extends React.Component<IProps> {
const { serviceType, configs, getStatus } = this.props;
return (
<div className="service-table-item">
<ServiceHeader serviceType={serviceType} title={`${serviceType} Service`}>
<StatusPanel type={serviceType} getStatus={getStatus} />
<ServiceHeader serviceType={serviceType} title={`${serviceType} ${intl.get('common.service')}`}>
<div className="btn-icon-with-desc blue" onClick={this.handleView}>
<Icon icon="#iconwatch" />
<span>{intl.get('common.view')}</span>
Expand Down
42 changes: 36 additions & 6 deletions src/utils/promQL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,21 @@ export let SUPPORT_METRICS =
},
],
memory: [
// {
// metric: 'memory_utilization',
// valueType: VALUE_TYPE.percentage,
// },
{
metric: 'memory_utilization',
metric: 'memory_used',
valueType: VALUE_TYPE.byte,
},
{
metric: 'memory_used_percentage',
valueType: VALUE_TYPE.percentage,
},
{
metric: 'memory_used',
valueType: VALUE_TYPE.byte,
metric: 'memory_actual_used_percentage',
valueType: VALUE_TYPE.percentage,
},
{
metric: 'memory_actual_used',
Expand All @@ -52,6 +60,18 @@ export let SUPPORT_METRICS =
metric: 'memory_free',
valueType: VALUE_TYPE.byte,
},
{
metric: 'memory_swap_total',
valueType: VALUE_TYPE.byte,
},
{
metric: 'memory_cached_buffer_used',
valueType: VALUE_TYPE.byte,
},
{
metric: 'memory_cached_buffer_used_percentage',
valueType: VALUE_TYPE.percentage,
},
],
load: [
{
Expand Down Expand Up @@ -100,6 +120,10 @@ export let SUPPORT_METRICS =
metric: 'inode_utilization',
valueType: VALUE_TYPE.percentage,
},
{
metric: 'root_fs_used_percentage',
valueType: VALUE_TYPE.percentage,
}
],
network: [
{
Expand Down Expand Up @@ -150,17 +174,22 @@ export let LINUX = (cluster?, device?: string): any => {
cpu_system: `100 * (sum by (instance)(increase(node_cpu_seconds_total{mode="system"${clusterSuffix1}}[1m])) / sum by (instance)(increase(node_cpu_seconds_total${clusterSuffix2}[1m])))`,

// memory relative:
memory_utilization: `(1 - node_memory_MemFree_bytes${clusterSuffix2} / node_memory_MemTotal_bytes${clusterSuffix2} )* 100`,
// memory_utilization: `(1 - node_memory_MemFree_bytes${clusterSuffix2} / node_memory_MemTotal_bytes${clusterSuffix2} )* 100`,
memory_used: `node_memory_MemTotal_bytes${clusterSuffix2} - node_memory_MemFree_bytes${clusterSuffix2}`,
memory_used_percentage: `((node_memory_MemTotal_bytes${clusterSuffix2} - node_memory_MemFree_bytes${clusterSuffix2}) / node_memory_MemTotal_bytes${clusterSuffix2} )* 100`,
memory_actual_used: `node_memory_MemTotal_bytes${clusterSuffix2} - node_memory_MemFree_bytes${clusterSuffix2} - node_memory_Buffers_bytes${clusterSuffix2} - node_memory_Cached_bytes${clusterSuffix2}`,
memory_actual_used_percentage: `((node_memory_MemTotal_bytes${clusterSuffix2} - node_memory_MemFree_bytes${clusterSuffix2} - node_memory_Buffers_bytes${clusterSuffix2} - node_memory_Cached_bytes${clusterSuffix2}) / node_memory_MemTotal_bytes${clusterSuffix2} )* 100`,
memory_free: `node_memory_MemFree_bytes${clusterSuffix2}`,
memory_cached_buffer_used: `node_memory_Buffers_bytes${clusterSuffix2} + node_memory_Cached_bytes${clusterSuffix2}`,
memory_cached_buffer_used_percentage: `((node_memory_Buffers_bytes${clusterSuffix2} + node_memory_Cached_bytes${clusterSuffix2}) / node_memory_MemTotal_bytes${clusterSuffix2} )* 100`,
memory_size: `node_memory_MemTotal_bytes${clusterSuffix2}`,

memory_swap_total: `node_memory_SwapTotal_bytes${clusterSuffix2}`,

// node load relative:
load_15s: `node_load1${clusterSuffix2}`,
load_5m: `node_load5${clusterSuffix2}`,
load_15m: `node_load15${clusterSuffix2}`,

// disk relative:
disk_used: `node_filesystem_size_bytes{${diskPararms}${devicePararms}${clusterSuffix1}} - node_filesystem_free_bytes{${diskPararms}${devicePararms}${clusterSuffix1}}`,
disk_free: `node_filesystem_avail_bytes{${diskPararms}${devicePararms}${clusterSuffix1}}`,
Expand All @@ -171,6 +200,7 @@ export let LINUX = (cluster?, device?: string): any => {
inode_utilization: `(1- (node_filesystem_files_free{${diskPararms}${devicePararms}${clusterSuffix1}}) / (node_filesystem_files{mountpoint="/",fstype!="rootfs"${clusterSuffix1}})) * 100`,
disk_used_percentage: `(node_filesystem_size_bytes{${diskPararms}${devicePararms}${clusterSuffix1}}-node_filesystem_free_bytes{${diskPararms}${devicePararms}${clusterSuffix1}}) *100/(node_filesystem_avail_bytes {${diskPararms}${devicePararms}${clusterSuffix1}}+(node_filesystem_size_bytes{${diskPararms}${devicePararms}${clusterSuffix1}}-node_filesystem_free_bytes{${diskPararms}${devicePararms}${clusterSuffix1}}))`,
disk_size: `node_filesystem_size_bytes{${diskPararms}${devicePararms}${clusterSuffix1}}`,
root_fs_used_percentage: `100 - ((node_filesystem_avail_bytes{fstype!="rootfs"${clusterSuffix1}} * 100) / node_filesystem_size_bytes{mountpoint="/",fstype!="rootfs"${clusterSuffix1}})`,

network_in_rate: `ceil(sum by(instance)(irate(node_network_receive_bytes_total{device=~"(eth|en)[a-z0-9]*"${clusterSuffix1}}[1m])))`,
network_out_rate: `ceil(sum by(instance)(irate(node_network_transmit_bytes_total{device=~"(eth|en)[a-z0-9]*"${clusterSuffix1}}[1m])))`,
Expand Down

0 comments on commit decbb98

Please sign in to comment.