Browse Source

..

Signed-off-by: min.tian <min.tian.cn@gmail.com>
min.tian 2 years ago
parent
commit
77b4e0d2ac

+ 1 - 1
client/src/consts/Localstorage.ts

@@ -1,7 +1,7 @@
 export const SESSION = 'CLOUD_SESSION';
 export const MILVUS_ADDRESS = 'milvus-address';
 export const LAST_TIME_ADDRESS = 'last-time-address';
-export const LAST_TIME_HAS_PROMETHEUS = 'last-time-has-prometheus';
+export const LAST_TIME_WITH_PROMETHEUS = 'last-time-with-prometheus';
 export const LAST_TIME_PROMETHEUS_ADDRESS = 'last-time-prometheus-address';
 export const LAST_TIME_PROMETHEUS_INSTANCE = 'last-time-prometheus-instance';
 export const LAST_TIME_PROMETHEUS_NAMESPACE = 'last-time-prometheus-namespace';

+ 10 - 0
client/src/consts/Prometheus.tsx

@@ -0,0 +1,10 @@
+export const WITH_PROMETHEUS = (window as any)?._env_?.WITH_PROMETHEUS || '';
+
+export const PROMETHEUS_ADDRESS =
+  (window as any)?._env_?.PROMETHEUS_ADDRESS || '';
+
+export const PROMETHEUS_INSTANCE_NAME =
+  (window as any)?._env_?.PROMETHEUS_INSTANCE_NAME || '';
+
+export const PROMETHEUS_NAMESPACE =
+  (window as any)?._env_?.PROMETHEUS_NAMESPACE || '';

+ 23 - 12
client/src/context/Prometheus.tsx

@@ -2,17 +2,23 @@ import React, { createContext, useContext, useEffect, useState } from 'react';
 import { PrometheusContextType } from './Types';
 import { authContext } from '../context/Auth';
 import {
-  LAST_TIME_HAS_PROMETHEUS,
+  LAST_TIME_WITH_PROMETHEUS,
   LAST_TIME_PROMETHEUS_ADDRESS,
   LAST_TIME_PROMETHEUS_INSTANCE,
   LAST_TIME_PROMETHEUS_NAMESPACE,
 } from '../consts/Localstorage';
 import { formatPrometheusAddress } from '../utils/Format';
 import { PrometheusHttp } from '../http/Prometheus';
+import {
+  PROMETHEUS_ADDRESS,
+  PROMETHEUS_INSTANCE_NAME,
+  PROMETHEUS_NAMESPACE,
+  WITH_PROMETHEUS,
+} from '../consts/Prometheus';
 
 export const prometheusContext = createContext<PrometheusContextType>({
-  hasPrometheus: false,
-  setHasPrometheus: () => {},
+  withPrometheus: false,
+  setWithPrometheus: () => {},
   isPrometheusReady: false,
   prometheusAddress: '',
   prometheusInstance: '',
@@ -26,24 +32,29 @@ const { Provider } = prometheusContext;
 export const PrometheusProvider = (props: { children: React.ReactNode }) => {
   const { isAuth } = useContext(authContext);
 
-  const [hasPrometheus, setHasPrometheus] = useState(
-    !!window.localStorage.getItem(LAST_TIME_HAS_PROMETHEUS)
+  const [withPrometheus, setWithPrometheus] = useState(
+    !!(
+      window.localStorage.getItem(LAST_TIME_WITH_PROMETHEUS) || WITH_PROMETHEUS
+    )
   );
   const [prometheusAddress, setPrometheusAddress] = useState(
-    window.localStorage.getItem(LAST_TIME_PROMETHEUS_ADDRESS) || ''
+    window.localStorage.getItem(LAST_TIME_PROMETHEUS_ADDRESS) ||
+      PROMETHEUS_ADDRESS
   );
   const [prometheusInstance, setPrometheusInstance] = useState(
-    window.localStorage.getItem(LAST_TIME_PROMETHEUS_INSTANCE) || ''
+    window.localStorage.getItem(LAST_TIME_PROMETHEUS_INSTANCE) ||
+      PROMETHEUS_INSTANCE_NAME
   );
   const [prometheusNamespace, setPrometheusNamespace] = useState(
-    window.localStorage.getItem(LAST_TIME_PROMETHEUS_NAMESPACE) || ''
+    window.localStorage.getItem(LAST_TIME_PROMETHEUS_NAMESPACE) ||
+      PROMETHEUS_NAMESPACE
   );
 
   const [isPrometheusReady, setIsPrometheusReady] = useState(false);
 
   useEffect(() => {
     if (!isAuth) return;
-    if (hasPrometheus) {
+    if (withPrometheus) {
       const prometheusAddressformat =
         formatPrometheusAddress(prometheusAddress);
       PrometheusHttp.setPrometheus({
@@ -53,7 +64,7 @@ export const PrometheusProvider = (props: { children: React.ReactNode }) => {
       }).then(({ isReady }: { isReady: boolean }) => {
         console.log('prometheus is ready?', isReady);
         if (isReady) {
-          window.localStorage.setItem(LAST_TIME_HAS_PROMETHEUS, 'true');
+          window.localStorage.setItem(LAST_TIME_WITH_PROMETHEUS, 'true');
           window.localStorage.setItem(
             LAST_TIME_PROMETHEUS_ADDRESS,
             prometheusAddress
@@ -77,8 +88,8 @@ export const PrometheusProvider = (props: { children: React.ReactNode }) => {
   return (
     <Provider
       value={{
-        hasPrometheus,
-        setHasPrometheus,
+        withPrometheus,
+        setWithPrometheus,
         isPrometheusReady,
         prometheusAddress,
         prometheusInstance,

+ 2 - 2
client/src/context/Types.ts

@@ -62,8 +62,8 @@ export type AuthContextType = {
 };
 
 export type PrometheusContextType = {
-  hasPrometheus: boolean;
-  setHasPrometheus: Dispatch<SetStateAction<boolean>>;
+  withPrometheus: boolean;
+  setWithPrometheus: Dispatch<SetStateAction<boolean>>;
   isPrometheusReady: boolean;
   prometheusAddress: string;
   prometheusInstance: string;

+ 7 - 15
client/src/pages/connect/AuthForm.tsx

@@ -9,19 +9,11 @@ import { ITextfieldConfig } from '../../components/customInput/Types';
 import { useFormValidation } from '../../hooks/Form';
 import { formatForm } from '../../utils/Form';
 import { MilvusHttp } from '../../http/Milvus';
-import { PrometheusHttp } from '../../http/Prometheus';
-import { formatAddress, formatPrometheusAddress } from '../../utils/Format';
+import { formatAddress } from '../../utils/Format';
 import { useNavigate } from 'react-router-dom';
 import { rootContext } from '../../context/Root';
 import { authContext } from '../../context/Auth';
-import {
-  MILVUS_ADDRESS,
-  LAST_TIME_ADDRESS,
-  LAST_TIME_HAS_PROMETHEUS,
-  LAST_TIME_PROMETHEUS_ADDRESS,
-  LAST_TIME_PROMETHEUS_INSTANCE,
-  LAST_TIME_PROMETHEUS_NAMESPACE,
-} from '../../consts/Localstorage';
+import { MILVUS_ADDRESS, LAST_TIME_ADDRESS } from '../../consts/Localstorage';
 import { CODE_STATUS } from '../../consts/Http';
 import { MILVUS_URL } from '../../consts/Milvus';
 import { CustomRadio } from '../../components/customRadio/CustomRadio';
@@ -143,8 +135,8 @@ export const AuthForm = (props: any) => {
   }, [form, attuTrans, warningTrans, classes.input]);
 
   const {
-    hasPrometheus,
-    setHasPrometheus,
+    withPrometheus,
+    setWithPrometheus,
     prometheusAddress,
     prometheusInstance,
     prometheusNamespace,
@@ -245,12 +237,12 @@ export const AuthForm = (props: any) => {
         </div>
         <div className={classes.sslWrapper}>
           <CustomRadio
-            defaultChecked={hasPrometheus}
+            defaultChecked={withPrometheus}
             label={attuTrans.prometheus}
-            handleChange={setHasPrometheus}
+            handleChange={setWithPrometheus}
           />
         </div>
-        {hasPrometheus &&
+        {withPrometheus &&
           prometheusConfigs.map(v => (
             <CustomInput
               type="text"

+ 0 - 0
client/src/pages/systemHealthy/HealthyIndex


+ 29 - 12
client/src/pages/systemHealthy/HealthyIndexDetailView.tsx

@@ -5,7 +5,7 @@ import LineChartSmall from './LineChartSmall';
 import { ENodeService, INodeTreeStructure } from './Types';
 import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
 import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
-import { useState } from 'react';
+import { Dispatch, SetStateAction, useState } from 'react';
 
 const getStyles = makeStyles((theme: Theme) => ({
   mainView: {
@@ -14,12 +14,10 @@ const getStyles = makeStyles((theme: Theme) => ({
   },
   healthyIndexItem: {
     display: 'flex',
-    marginTop: '8px',
+    marginTop: '6px',
     justifyContent: 'space-between',
   },
   healthyIndexLabel: {
-    // width: `${CHART_LABEL_WIDTH}px`,
-
     fontWeight: 500,
     fontSize: '12px',
     color: '#444',
@@ -30,13 +28,12 @@ const getStyles = makeStyles((theme: Theme) => ({
   healthyIndexLabelText: {},
   healthyIndexRow: {
     width: `${CHART_WIDTH}px`,
-    // border: '1px solid brown',
   },
   chartItem: {
     margin: '8px 0',
     display: 'flex',
     justifyContent: 'space-between',
-    alignItems: 'flex-end',
+    alignItems: 'center',
   },
   chartLabel: {
     width: `50px`,
@@ -48,8 +45,6 @@ const getStyles = makeStyles((theme: Theme) => ({
   chart: {
     height: `${LINE_CHART_SMALL_HEIGHT}px`,
     width: `${CHART_WIDTH}px`,
-
-    // border: '1px solid brown',
   },
 }));
 
@@ -109,15 +104,22 @@ const HealthyIndexTreeItem = ({ node }: { node: INodeTreeStructure }) => {
 
 const HealthyIndexWithTree = ({
   nodeTree,
+  setSelectedService,
 }: {
   nodeTree: INodeTreeStructure;
+  setSelectedService: Dispatch<SetStateAction<ENodeService>>;
 }) => {
   const classes = getStyles();
   return (
     <div className={classes.mainView}>
       {!!nodeTree && (
         <div className={classes.healthyIndexItem}>
-          <div className={classes.healthyIndexLabel}>{nodeTree.label}</div>
+          <div
+            className={classes.healthyIndexLabel}
+            onClick={() => setSelectedService(ENodeService.root)}
+          >
+            {nodeTree.label}
+          </div>
           <div className={classes.healthyIndexRow}>
             <HealthyIndexRow statusList={nodeTree?.healthyStatus || []} />
           </div>
@@ -132,8 +134,10 @@ const HealthyIndexWithTree = ({
 
 const HealthyIndexWithoutTree = ({
   nodeTree,
+  setSelectedService,
 }: {
   nodeTree: INodeTreeStructure;
+  setSelectedService: Dispatch<SetStateAction<ENodeService>>;
 }) => {
   const classes = getStyles();
   return (
@@ -143,7 +147,12 @@ const HealthyIndexWithoutTree = ({
           key={`${node.service}-${node.type}`}
           className={classes.healthyIndexItem}
         >
-          <div className={classes.healthyIndexLabel}>{node.label}</div>
+          <div
+            className={classes.healthyIndexLabel}
+            onClick={() => setSelectedService(node.service)}
+          >
+            {node.label}
+          </div>
           <div className={classes.healthyIndexRow}>
             <HealthyIndexRow statusList={node.healthyStatus} />
           </div>
@@ -155,13 +164,21 @@ const HealthyIndexWithoutTree = ({
 
 const HealthyIndexDetailView = ({
   nodeTree,
+  setSelectedService,
 }: {
   nodeTree: INodeTreeStructure;
+  setSelectedService: Dispatch<SetStateAction<ENodeService>>;
 }) => {
   return nodeTree.service === ENodeService.milvus ? (
-    <HealthyIndexWithoutTree nodeTree={nodeTree} />
+    <HealthyIndexWithoutTree
+      nodeTree={nodeTree}
+      setSelectedService={setSelectedService}
+    />
   ) : (
-    <HealthyIndexWithTree nodeTree={nodeTree} />
+    <HealthyIndexWithTree
+      nodeTree={nodeTree}
+      setSelectedService={setSelectedService}
+    />
   );
 };
 

+ 1 - 1
client/src/pages/systemHealthy/HealthyIndexLegend.tsx

@@ -24,7 +24,7 @@ const legendData = [
 const getStyles = makeStyles((theme: Theme) => ({
   legendItem: {
     display: 'flex',
-    marginLeft: '16px',
+    marginLeft: '12px',
     fontSize: '10px',
     alignItems: 'flex-end',
   },

+ 8 - 6
client/src/pages/systemHealthy/HealthyIndexOverview.tsx

@@ -28,7 +28,7 @@ const getStyles = makeStyles((theme: Theme) => ({
     width: `${MAIN_VIEW_WIDTH}px`,
     height: `${TOPO_HEIGHT}px`,
     overflow: 'auto',
-    padding: '16px 56px 16px 24px',
+    padding: '12px 56px 0px 24px',
     // boxShadow: '0 0 5px #ccc',
     fontSize: '14px',
   },
@@ -50,11 +50,11 @@ const getStyles = makeStyles((theme: Theme) => ({
     display: 'flex',
     alignItems: 'flex-end',
   },
-  settingIcon: { marginLeft: '16px', display: 'flex', alignItems: 'flex-end' },
+  settingIcon: { marginLeft: '12px', display: 'flex', alignItems: 'flex-end' },
 
-  chartView: { width: '100%', marginTop: '30px' },
+  chartView: { width: '100%', marginTop: '24px' },
   chartItem: {
-    margin: '24px 0',
+    margin: '16px 0',
     display: 'flex',
     justifyContent: 'space-between',
     alignItems: 'flex-end',
@@ -79,6 +79,7 @@ const HealthyIndexOverview = ({
   setThreshold,
   timeRange,
   setTimeRange,
+  setSelectedService
 }: {
   selectedNode: INodeTreeStructure;
   lineChartsData: ILineChartData[];
@@ -86,6 +87,7 @@ const HealthyIndexOverview = ({
   setThreshold: Dispatch<SetStateAction<IThreshold>>;
   timeRange: ITimeRangeOption;
   setTimeRange: Dispatch<SetStateAction<ITimeRangeOption>>;
+  setSelectedService: Dispatch<SetStateAction<ENodeService>>;
 }) => {
   const classes = getStyles();
   return (
@@ -114,10 +116,10 @@ const HealthyIndexOverview = ({
           </div>
         </div>
       </div>
-      <HealthyIndexDetailView nodeTree={selectedNode} />
+      <HealthyIndexDetailView nodeTree={selectedNode} setSelectedService={setSelectedService} />
       {selectedNode.service === ENodeService.milvus && (
         <div className={classes.chartView}>
-          <div className={classes.title}>Search Query History</div>
+          <div className={classes.titleMain}>Search Query History</div>
           {lineChartsData.map(chartData => (
             <div className={classes.chartItem}>
               <div className={classes.chartLabel}>{chartData.label}</div>

+ 9 - 3
client/src/pages/systemHealthy/LineChartLarge.tsx

@@ -48,16 +48,22 @@ const LineChartLarge = ({
       height={height}
       style={{ overflow: 'visible' }}
       fontSize={fontSize}
+      fontWeight={500}
     >
       <g className="x-axis">
         <line x1={0} y1={height} x2={width} y2={height} stroke="#666" />
       </g>
       <g className="y-axis">
         <line x1={0} y1={0} x2={0} y2={height} stroke="#666" />
-        <text x={-LINE_LABEL_Y_PADDING} y={height} textAnchor="end">
+        <text x={-LINE_LABEL_Y_PADDING} y={height} textAnchor="end" fill="#555">
           {0}
         </text>
-        <text x={-LINE_LABEL_Y_PADDING} y={fontSize} textAnchor="end">
+        <text
+          x={-LINE_LABEL_Y_PADDING}
+          y={fontSize}
+          textAnchor="end"
+          fill="#555"
+        >
           {format(maxData)}
         </text>
         {unit && (
@@ -65,7 +71,7 @@ const LineChartLarge = ({
             x={-LINE_LABEL_Y_PADDING}
             y={fontSize * 2}
             textAnchor="end"
-            fill={'#333'}
+            fill={'#666'}
             fontSize={fontSize - 2}
           >
             ({unit})

+ 9 - 2
client/src/pages/systemHealthy/LineChartSmall.tsx

@@ -50,6 +50,7 @@ const LineChartSmall = ({
       height={height}
       style={{ overflow: 'visible' }}
       fontSize={fontSize}
+      fontWeight={500}
     >
       <g className="x-axis">
         <line x1={0} y1={height} x2={width} y2={height} stroke="#666" />
@@ -63,13 +64,19 @@ const LineChartSmall = ({
         />
       </g>
       <g className="y-axis">
-        <text x={width + LINE_LABEL_Y_PADDING} y={height} textAnchor="start">
+        <text
+          x={width + LINE_LABEL_Y_PADDING}
+          y={height}
+          textAnchor="start"
+          fill="#555"
+        >
           {0}
         </text>
         <text
           x={width + LINE_LABEL_Y_PADDING}
           y={yScale(maxData) + 3}
           textAnchor="start"
+          fill="#555"
         >
           {format(maxData)}
         </text>
@@ -78,8 +85,8 @@ const LineChartSmall = ({
             x={width + LINE_LABEL_Y_PADDING}
             y={yScale(maxData) + 3 + fontSize}
             textAnchor="start"
-            fill={'#333'}
             fontSize={fontSize - 2}
+            fill="#555"
           >
             ({unit})
           </text>

+ 1 - 2
client/src/pages/systemHealthy/SystemHealthyView.tsx

@@ -132,7 +132,6 @@ const SystemHealthyView = () => {
       step: timeRange.step,
     })) as IPrometheusAllData;
     setPrometheusData(result);
-    console.log('prometheus data', result);
   };
 
   useEffect(() => {
@@ -140,7 +139,6 @@ const SystemHealthyView = () => {
   }, [timeRange]);
 
   useInterval(() => {
-    console.log('interval');
     updateData();
   }, INTERVAL);
 
@@ -177,6 +175,7 @@ const SystemHealthyView = () => {
           setThreshold={setThreshold}
           timeRange={timeRange}
           setTimeRange={setTimeRange}
+          setSelectedService={setSelectedService}
         />
       </div>
     </div>

+ 0 - 1
client/src/pages/systemHealthy/ThresholdSetting.tsx

@@ -58,7 +58,6 @@ function ThresholdSettingDialog({
 }) {
   const classes = getStyles();
   const handleClose = () => {
-    console.log('form', form);
     setThreshold({ ...form, memory: form.memory * 1024 * 1024 * 1024 });
     onClose();
   };

+ 5 - 3
client/src/pages/systemHealthy/Topology.tsx

@@ -55,6 +55,8 @@ const getStyles = makeStyles((theme: Theme) => ({
   },
 }));
 
+const randomList = Array(10).fill(0).map(_ => Math.random());
+
 const nodesLayout = (
   nodes: INodeTreeStructure[],
   width: number,
@@ -65,15 +67,15 @@ const nodesLayout = (
     (nodes.find(node => node.type === ENodeType.coord) as INodeTreeStructure);
   const childrenNodes = nodes.filter(node => node !== rootNode);
 
-  const rootPos = [300, height * 0.45];
+  const rootPos = [248, height * 0.45];
   const angleStep = (2 * Math.PI) / Math.max(childrenNodes.length, 3);
-  const randomBias = angleStep * 0.4;
+  const angleBias = angleStep * 0.4;
   const childrenPos = childrenNodes.map((node, i) => [
     rootPos[0] + Math.cos(angleStep * i) * TOPO_LINK_LENGTH[0],
     rootPos[1] + Math.sin(angleStep * i) * TOPO_LINK_LENGTH[0],
   ]);
   const subChildrenPos = childrenNodes.map((node, i) => {
-    const angle = angleStep * i + (Math.random() - 0.5) * randomBias;
+    const angle = angleStep * i + (randomList[i] - 0.5) * angleBias;
     return [
       rootPos[0] + Math.cos(angle) * TOPO_LINK_LENGTH[1],
       rootPos[1] + Math.sin(angle) * TOPO_LINK_LENGTH[1],

+ 5 - 5
client/src/pages/systemHealthy/consts.ts

@@ -1,12 +1,12 @@
 import { EHealthyStatus, ITimeRangeOption } from './Types';
 
-export const TOPO_WIDTH = 800;
-export const TOPO_HEIGHT = 600;
+export const TOPO_WIDTH = 600;
+export const TOPO_HEIGHT = 560;
 export const TOPO_NODE_R = [68, 45, 30];
 export const TOPO_LINK_LENGTH = [160, 270];
 
-export const MAIN_VIEW_WIDTH = 600;
-export const CHART_WIDTH = 500;
+export const MAIN_VIEW_WIDTH = 560;
+export const CHART_WIDTH = 450;
 export const HEALTHY_INDEX_ROW_HEIGHT = 20;
 export const HEALTHY_INDEX_ROW_GAP_RATIO = 0.3;
 export const HEALTHY_STATUS_COLORS = {
@@ -16,7 +16,7 @@ export const HEALTHY_STATUS_COLORS = {
   [EHealthyStatus.failed]: '#F16415',
 };
 
-export const LINE_CHART_LARGE_HEIGHT = 60;
+export const LINE_CHART_LARGE_HEIGHT = 56;
 export const LINE_CHART_SMALL_HEIGHT = 42;
 export const LINE_COLOR = '#394E97';
 export const LINE_LABEL_Y_PADDING = 6;

+ 0 - 172
client/src/pages/systemHealthy/data.json

@@ -1,172 +0,0 @@
-{
-  "totalVectorsCount": [
-    -1, -1, -1, -1, -1, -1, -1, -1, -1, 10100, 10100, 10100, 10100, 10100,
-    10100, 10100, 10100, 10100, 10100, 10100, 10100
-  ],
-  "searchVectorsCount": [
-    -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, 11, 11, 11, 11, 11, 11, 11, 34, 34,
-    34, 85
-  ],
-  "sqLatency": [
-    -1, -1, -1, -1, -1, -1, -1, -1, -1, 506.8829768717992, 0, 0, 0, 0, 0, 0, 0,
-    0, 508.07466666666664, 0, 0, 1995.776
-  ],
-  "meta": [
-    -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-  ],
-  "msgstream": [
-    -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-  ],
-  "objstorage": [
-    -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
-  ],
-  "rootNodes": [
-    {
-      "type": "coord",
-      "pod": "tianmin-milvus-rootcoord-66bb975f6d-jxx6s",
-      "cpu": [
-        376.13, 758.03, 1155.1, 1559.85, 1944, 2332.24, 2735.8, 3137.48,
-        3521.33, 3920.21, 4298.6, 4674.12, 5040.54
-      ],
-      "memory": [
-        267030528, 267030528, 259407872, 257298432, 257298432, 256708608,
-        256643072, 256626688, 256598016, 256598016, 256794624, 256786432,
-        256786432
-      ]
-    }
-  ],
-  "queryNodes": [
-    {
-      "type": "coord",
-      "pod": "tianmin-milvus-querycoord-d779dfdd4-njjp5",
-      "cpu": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 0.004354861111111111,
-        0.004148263888888889, 0.004453819444444443, 0.004365277777777779,
-        0.004188541666666667, 0.004348263888888889, 0.004374305555555556,
-        0.004205555555555552, 0.004389583333333336, 0.004275347222222218,
-        0.004134375000000006, 0.004095833333333335
-      ],
-      "memory": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 198668288, 198307840, 200466432,
-        199086080, 199942144, 194887680, 200523776, 196640768, 199692288,
-        194867200, 196759552, 198111232
-      ]
-    },
-    {
-      "type": "node",
-      "pod": "tianmin-milvus-querynode-68866999f4-t8wtz",
-      "cpu": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 0.006875347222222222,
-        0.007737152777777779, 0.007752083333333333, 0.006654513888888888,
-        0.006953125, 0.007668055555555553, 0.007513194444444448,
-        0.006884374999999999, 0.007900347222222229, 0.007532291666666661,
-        0.007135069444444437, 0.007169791666666675
-      ],
-      "memory": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 229572608, 223236096, 221335552,
-        219553792, 219643904, 220409856, 220393472, 219332608, 227799040,
-        227758080, 226185216, 226619392
-      ]
-    },
-    {
-      "type": "node",
-      "pod": "tianmin-milvus-querynode-68866999f4-ftmql",
-      "cpu": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 0.0060999999999999995,
-        0.006392708333333332, 0.006654861111111114, 0.005995486111111109,
-        0.005906597222222223, 0.006739236111111108, 0.006666319444444444,
-        0.005960416666666669, 0.007247916666666667, 0.006772916666666665,
-        0.006012847222222225, 0.006104513888888887
-      ],
-      "memory": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 234229760, 235794432, 235827200,
-        234188800, 234881024, 236142592, 236150784, 235180032, 240599040,
-        240476160, 239734784, 239882240
-      ]
-    }
-  ],
-  "indexNodes": [
-    {
-      "type": "coord",
-      "pod": "tianmin-milvus-indexcoord-864d49b47f-t7w4k",
-      "cpu": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 0.0010534722222222221,
-        0.0009885416666666666, 0.0010402777777777776, 0.001061805555555556,
-        0.0010104166666666664, 0.0010604166666666663, 0.001054861111111111,
-        0.0010246527777777784, 0.0010458333333333335, 0.0009649305555555543,
-        0.0009010416666666683, 0.0009291666666666664
-      ],
-      "memory": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 172568576, 181334016, 181194752,
-        181170176, 180797440, 179240960, 179204096, 178769920, 179372032,
-        179511296, 179613696, 179302400
-      ]
-    },
-    {
-      "type": "node",
-      "pod": "tianmin-milvus-indexnode-6cdc5f745b-j5ttn",
-      "cpu": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 0.0007239583333333333,
-        0.0006895833333333333, 0.000747222222222222, 0.0007375000000000003,
-        0.000704861111111111, 0.000752777777777778, 0.0007406249999999994,
-        0.0006965277777777779, 0.0007451388888888892, 0.0006732638888888884,
-        0.0006333333333333336, 0.0006513888888888896
-      ],
-      "memory": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 1075355648, 1075339264, 1075503104,
-        1075728384, 1075642368, 1075568640, 1075712000, 1075863552, 1076625408,
-        1075990528, 1076199424, 1076326400
-      ]
-    }
-  ],
-  "dataNodes": [
-    {
-      "type": "coord",
-      "pod": "tianmin-milvus-datacoord-bb57486b-w29cx",
-      "cpu": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 0.0037305555555555555,
-        0.004054513888888888, 0.0042069444444444454, 0.0036847222222222203,
-        0.0034364583333333343, 0.004098611111111114, 0.004046180555555555,
-        0.003398958333333333, 0.0039364583333333335, 0.003711805555555559,
-        0.003448263888888887, 0.003430208333333332
-      ],
-      "memory": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 205545472, 201728000, 208707584,
-        206086144, 202588160, 204652544, 202850304, 207249408, 210554880,
-        203558912, 204767232, 208343040
-      ]
-    },
-    {
-      "type": "node",
-      "pod": "tianmin-milvus-datanode-7b759b9697-snqqx",
-      "cpu": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 0.005490972222222223,
-        0.005468055555555554, 0.005621180555555557, 0.005448958333333332,
-        0.005135763888888888, 0.0055760416666666675, 0.0055836805555555535,
-        0.005151388888888894, 0.005699305555555551, 0.005477777777777778,
-        0.00502673611111111, 0.005077430555555556
-      ],
-      "memory": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 222609408, 235073536, 235151360,
-        235159552, 234332160, 233107456, 233111552, 232488960, 233603072,
-        233611264, 232898560, 233619456
-      ]
-    },
-    {
-      "type": "node",
-      "pod": "tianmin-milvus-datanode-7b759b9697-hzd9w",
-      "cpu": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 0.0060996527777777785,
-        0.006033333333333331, 0.006782291666666668, 0.006199999999999998,
-        0.005823958333333334, 0.007095486111111116, 0.006971180555555555,
-        0.005759722222222218, 0.006396527777777779, 0.0057159722222222265,
-        0.005308680555555551, 0.005292708333333327
-      ],
-      "memory": [
-        -1, -1, -1, -1, -1, -1, -1, -1, -1, 222482432, 222982144, 223010816,
-        222834688, 222400512, 223166464, 223830016, 223051776, 223911936,
-        223911936, 223653888, 223993856
-      ]
-    }
-  ]
-}

+ 0 - 1
client/src/pages/systemHealthy/dataHandler.ts

@@ -22,7 +22,6 @@ export const getInternalNode = (
       const memory = node.memory[i];
       if (cpu === -1) return EHealthyStatus.noData;
       if (cpu === -2) return EHealthyStatus.failed;
-      console.log();
       return cpu >= threshold.cpu || memory >= threshold.memory
         ? EHealthyStatus.warning
         : EHealthyStatus.healthy;

+ 198 - 0
client/src/pages/systemHealthy/prometheusDataCase.json

@@ -0,0 +1,198 @@
+{
+  "totalVectorsCount": [
+    10100, 10100, 10100, 10100, 10100, 10100, 20200, 20200, 20200, 20200, 20200,
+    20200, 20200, 20200, 20200, 20200, 20200, 20200, 20200, 20200, 20200
+  ],
+  "searchVectorsCount": [
+    51, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+  ],
+  "sqLatency": [
+    0, 1995.776, 0, 0, 509.44000000000005, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0
+  ],
+  "meta": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+  "msgstream": [
+    0.9999987192278481, 1.000001241850357, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1
+  ],
+  "objstorage": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+  "rootNodes": [
+    {
+      "type": "coord",
+      "pod": "tianmin-milvus-rootcoord-66bb975f6d-jxx6s",
+      "cpu": [
+        0.012685416666666671, 0.012543402777777778, 0.012973958333333353,
+        0.01245138888888887, 0.014343055555555553, 0.01412222222222223,
+        0.014353472222222226, 0.01409826388888888, 0.013789930555555574,
+        0.01384513888888888, 0.013060416666666647, 0.013064236111111112,
+        0.012952777777777808, 0.013211805555555555, 0.013215277777777791,
+        0.013023958333333275, 0.013395138888888911, 0.01334201388888889,
+        0.012905902777777796, 0.013392708333333303, 0.013308333333333356
+      ],
+      "memory": [
+        256786432, 256786432, 256163840, 256147456, 256143360, 256143360,
+        256139264, 234467328, 227409920, 226013184, 226013184, 226013184,
+        224165888, 224165888, 224063488, 224063488, 223633408, 223633408,
+        223633408, 223633408, 223592448
+      ]
+    }
+  ],
+  "queryNodes": [
+    {
+      "type": "coord",
+      "pod": "tianmin-milvus-querycoord-d779dfdd4-njjp5",
+      "cpu": [
+        0.004101041666666663, 0.003982291666666669, 0.004053125,
+        0.004022916666666671, 0.004190624999999994, 0.004188888888888892,
+        0.004214930555555551, 0.004066666666666663, 0.004054513888888888,
+        0.004250694444444447, 0.004367361111111118, 0.004352083333333338,
+        0.004473263888888886, 0.004397569444444448, 0.004364236111111097,
+        0.00445347222222223, 0.004335069444444441, 0.004356944444444445,
+        0.004137847222222225, 0.004144444444444449, 0.004073263888888887
+      ],
+      "memory": [
+        196358144, 199794688, 196919296, 196612096, 196096000, 195846144,
+        200585216, 199811072, 199643136, 200392704, 195579904, 197345280,
+        199356416, 199155712, 200818688, 201146368, 198569984, 199335936,
+        198352896, 201076736, 196235264
+      ]
+    },
+    {
+      "type": "node",
+      "pod": "tianmin-milvus-querynode-68866999f4-t8wtz",
+      "cpu": [
+        0.007112152777777775, 0.006854513888888884, 0.0073892361111111094,
+        0.006928472222222221, 0.008007291666666671, 0.008076736111111116,
+        0.008597916666666663, 0.008150694444444436, 0.007825694444444448,
+        0.00805312500000001, 0.007207638888888887, 0.007342013888888882,
+        0.00695937500000001, 0.007777430555555548, 0.0076819444444444366,
+        0.007389583333333355, 0.007785763888888873, 0.00781284722222223,
+        0.007146874999999998, 0.007248263888888889, 0.007239236111111103
+      ],
+      "memory": [
+        226652160, 224366592, 222994432, 227840000, 228249600, 226996224,
+        274440192, 251985920, 244887552, 256131072, 255901696, 255942656,
+        253829120, 255168512, 255004672, 261414912, 261603328, 261533696,
+        260169728, 260403200, 260911104
+      ]
+    },
+    {
+      "type": "node",
+      "pod": "tianmin-milvus-querynode-68866999f4-ftmql",
+      "cpu": [
+        0.006090277777777781, 0.0058100694444444415, 0.006048611111111121,
+        0.005899652777777773, 0.006252430555555561, 0.0062645833333333355,
+        0.006651388888888887, 0.0061711805555555565, 0.005942708333333336,
+        0.006573958333333331, 0.0064229166666666514, 0.006414583333333357,
+        0.006329513888888888, 0.006902083333333324, 0.006721180555555545,
+        0.00663472222222222, 0.006575694444444448, 0.006790277777777792,
+        0.006086458333333332, 0.006110763888888882, 0.005955902777777769
+      ],
+      "memory": [
+        241979392, 237637632, 237838336, 245350400, 245428224, 244047872,
+        294604800, 293490688, 293425152, 293871616, 293416960, 293269504,
+        293273600, 294273024, 294141952, 294559744, 294559744, 294158336,
+        293429248, 293548032, 293933056
+      ]
+    }
+  ],
+  "indexNodes": [
+    {
+      "type": "coord",
+      "pod": "tianmin-milvus-indexcoord-864d49b47f-t7w4k",
+      "cpu": [
+        0.0009246527777777776, 0.0009281249999999986, 0.0009041666666666674,
+        0.0009208333333333327, 0.0009611111111111114, 0.0009899305555555553,
+        0.0009916666666666687, 0.0009406249999999971, 0.0009343750000000028,
+        0.0009451388888888859, 0.0009118055555555591, 0.0009263888888888872,
+        0.0009142361111111125, 0.0009312499999999978, 0.0009114583333333333,
+        0.0009156250000000002, 0.0009107638888888896, 0.0009145833333333344,
+        0.001040624999999997, 0.0010041666666666693, 0.0010395833333333314
+      ],
+      "memory": [
+        179036160, 179437568, 178999296, 179400704, 179265536, 179404800,
+        179617792, 179322880, 179195904, 179769344, 179130368, 179163136,
+        179671040, 179466240, 179105792, 179281920, 179163136, 179449856,
+        179531776, 179519488, 179597312
+      ]
+    },
+    {
+      "type": "node",
+      "pod": "tianmin-milvus-indexnode-6cdc5f745b-j5ttn",
+      "cpu": [
+        0.0006562499999999992, 0.0006225694444444447, 0.000621180555555555,
+        0.000625, 0.0006256944444444458, 0.0006343749999999994,
+        0.0008763888888888892, 0.0006246527777777781, 0.0006236111111111104,
+        0.0006934027777777787, 0.0007628472222222212, 0.0007402777777777775,
+        0.0007593750000000002, 0.0007652777777777785, 0.0007510416666666665,
+        0.0007649305555555546, 0.0007270833333333352, 0.0007420138888888891,
+        0.0006767361111111115, 0.0006892361111111079, 0.0006680555555555559
+      ],
+      "memory": [
+        1075818496, 1075908608, 1076088832, 1075875840, 1076109312, 1076006912,
+        1401651200, 1401458688, 1401626624, 1401880576, 1401569280, 1401815040,
+        1401688064, 1401462784, 1401683968, 1401614336, 1401364480, 1401761792,
+        1401597952, 1401376768, 1401483264
+      ]
+    }
+  ],
+  "dataNodes": [
+    {
+      "type": "coord",
+      "pod": "tianmin-milvus-datacoord-bb57486b-w29cx",
+      "cpu": [
+        0.0034170138888888917, 0.0033708333333333307, 0.003458333333333338,
+        0.003440277777777775, 0.0035854166666666664, 0.0036586805555555517,
+        0.003824305555555559, 0.0035819444444444393, 0.0035041666666666693,
+        0.003850694444444448, 0.0038048611111111087, 0.0037906250000000023,
+        0.0037343750000000064, 0.004230902777777774, 0.004072916666666657,
+        0.0041246527777777766, 0.00406284722222223, 0.004109374999999997,
+        0.003622916666666672, 0.0035673611111111036, 0.003509027777777776
+      ],
+      "memory": [
+        207458304, 205180928, 205942784, 203255808, 205172736, 204587008,
+        204673024, 207888384, 207896576, 208162816, 206340096, 207425536,
+        207859712, 208457728, 207384576, 206680064, 207507456, 204734464,
+        206397440, 206385152, 204709888
+      ]
+    },
+    {
+      "type": "node",
+      "pod": "tianmin-milvus-datanode-7b759b9697-snqqx",
+      "cpu": [
+        0.005009374999999999, 0.005132291666666664, 0.005037152777777784,
+        0.0051555555555555565, 0.005372916666666659, 0.005334722222222218,
+        0.005506250000000013, 0.005367013888888879, 0.005113541666666666,
+        0.005218402777777777, 0.005051388888888889, 0.00507847222222223,
+        0.0049961805555555515, 0.0053750000000000065, 0.005430902777777789,
+        0.005427083333333308, 0.005367013888888911, 0.005399305555555556,
+        0.005404861111111106, 0.0053663194444444505, 0.005429861111111083
+      ],
+      "memory": [
+        233619456, 232636416, 232497152, 232665088, 232919040, 232497152,
+        260325376, 259923968, 260128768, 266887168, 266567680, 266571776,
+        266575872, 267214848, 267214848, 267214848, 267223040, 267223040,
+        266584064, 266481664, 266694656
+      ]
+    },
+    {
+      "type": "node",
+      "pod": "tianmin-milvus-datanode-7b759b9697-hzd9w",
+      "cpu": [
+        0.005274652777777773, 0.0052645833333333295, 0.005237500000000005,
+        0.005409027777777784, 0.00546284722222222, 0.0052670138888888905,
+        0.005463541666666663, 0.0053881944444444385, 0.005268055555555564,
+        0.00593715277777777, 0.006545833333333332, 0.006434374999999998,
+        0.006494444444444443, 0.006991666666666687, 0.006936111111111087,
+        0.007105902777777797, 0.006855208333333312, 0.006859375000000006,
+        0.005905555555555553, 0.005819791666666687, 0.0057913194444444436
+      ],
+      "memory": [
+        223993856, 223170560, 223100928, 223793152, 223834112, 222822400,
+        257933312, 257347584, 257466368, 257581056, 257581056, 257318912,
+        257318912, 257642496, 257642496, 257642496, 257966080, 258170880,
+        257781760, 257511424, 257298432
+      ]
+    }
+  ]
+}

+ 2 - 3
server/src/prometheus/prometheus.service.ts

@@ -82,7 +82,7 @@ export class PrometheusService {
       .get(`http://${prometheusAddress}/-/ready`)
       .then(res => res?.status === 200)
       .catch(err => {
-        // console.log(err);
+        console.log(err);
         return false;
       });
     return result;
@@ -96,12 +96,11 @@ export class PrometheusService {
       `&start=${new Date(+start).toISOString()}` +
       `&end=${new Date(+end).toISOString()}` +
       `&step=${step / 1000}s`;
-    console.log(url);
     const result = await axios
       .get(url)
       .then(res => res.data)
       .catch(err => {
-        // console.log(err);
+        console.log(err);
         return { status: 'failed' };
       });
     return result;