浏览代码

Add rpm and Fix node info (#97)

* add rpm

Signed-off-by: nameczz <zizhao.chen@zilliz.com>

* fix node length info

Signed-off-by: nameczz <zizhao.chen@zilliz.com>

* remove console, change interval time

Signed-off-by: nameczz <zizhao.chen@zilliz.com>

* remove console

Signed-off-by: nameczz <zizhao.chen@zilliz.com>
nameczz 2 年之前
父节点
当前提交
800823c217
共有 4 个文件被更改,包括 30 次插入24 次删除
  1. 18 8
      client/src/plugins/system/SystemView.tsx
  2. 8 13
      server/generate-csv.ts
  3. 2 1
      server/package.json
  4. 2 2
      server/src/collections/collections.service.ts

+ 18 - 8
client/src/plugins/system/SystemView.tsx

@@ -75,14 +75,19 @@ const parseJson = (jsonData: any) => {
     memoryUsage: 0,
     memoryUsage: 0,
   };
   };
 
 
-  jsonData?.response?.nodes_info.forEach((node: any) => {
-    const type = node?.infos?.type;
-    const has_error = node?.infos?.has_error;
+  const workingNodes = jsonData?.response?.nodes_info.filter(
+    (node: any) => node?.infos?.has_error !== true
+  );
 
 
-    if (has_error) {
-      return;
+  workingNodes.forEach((node: any) => {
+    const type = node?.infos?.type;
+    if (node.connected) {
+      node.connected = node.connected.filter((v: any) =>
+        workingNodes.find(
+          (item: any) => v.connected_identifier === item.identifier
+        )
+      );
     }
     }
-
     // coordinator node
     // coordinator node
     if (type?.toLowerCase().includes('coord')) {
     if (type?.toLowerCase().includes('coord')) {
       nodes.push(node);
       nodes.push(node);
@@ -109,7 +114,7 @@ const SystemView: any = () => {
   // const { t } = useTranslation('systemView');
   // const { t } = useTranslation('systemView');
 
 
   const classes = getStyles();
   const classes = getStyles();
-  const INTERVAL = 10000;
+  const INTERVAL = 60000;
 
 
   const [data, setData] = useState<{
   const [data, setData] = useState<{
     nodes: any;
     nodes: any;
@@ -162,7 +167,12 @@ const SystemView: any = () => {
         <LineChartCard title={t('latencyTitle')} value={latency} />
         <LineChartCard title={t('latencyTitle')} value={latency} />
       </div> */}
       </div> */}
       <div className={classes.contentContainer}>
       <div className={classes.contentContainer}>
-        <Topo nodes={nodes} setNode={setNode} setCord={setCord} />
+        <Topo
+          nodes={nodes}
+          childNodes={childNodes}
+          setNode={setNode}
+          setCord={setCord}
+        />
         <DataCard node={selectedNode} extend />
         <DataCard node={selectedNode} extend />
       </div>
       </div>
 
 

+ 8 - 13
server/generate-csv.ts

@@ -3,19 +3,14 @@ import { createObjectCsvWriter as createCsvWriter } from 'csv-writer';
 // use to test vector insert
 // use to test vector insert
 const csvWriter = createCsvWriter({
 const csvWriter = createCsvWriter({
   path: './vectors.csv',
   path: './vectors.csv',
-  header: [
-    { id: 'vector', title: 'vector' },
-    { id: 'name', title: 'name' },
-    { id: 'age', title: 'age' },
-    { id: 'job', title: 'job' },
-  ],
+  header: [{ id: 'vector', title: 'vector' }],
 });
 });
 
 
-const records = [];
+const records: any[] = [];
 
 
 const generateVector = (dimension: number) => {
 const generateVector = (dimension: number) => {
   let index = 0;
   let index = 0;
-  const vectors = [];
+  const vectors: any[] = [];
   while (index < dimension) {
   while (index < dimension) {
     vectors.push(1 + Math.random());
     vectors.push(1 + Math.random());
     index++;
     index++;
@@ -23,13 +18,13 @@ const generateVector = (dimension: number) => {
   return JSON.stringify(vectors);
   return JSON.stringify(vectors);
 };
 };
 
 
-while (records.length < 50000) {
-  const value = generateVector(4);
+while (records.length < 1000) {
+  const value = generateVector(960);
   records.push({
   records.push({
     vector: value,
     vector: value,
-    name: `${records.length}_id`,
-    age: records.length * 2,
-    job: Math.random() * 1000 > 500 ? 'designer' : 'programer',
+    // name: `${records.length}_id`,
+    // age: records.length * 2,
+    // job: Math.random() * 1000 > 500 ? 'designer' : 'programer',
   });
   });
 }
 }
 
 

+ 2 - 1
server/package.json

@@ -124,7 +124,8 @@
     "linux": {
     "linux": {
       "icon": "./build/zilliz.icns",
       "icon": "./build/zilliz.icns",
       "target": [
       "target": [
-        "deb"
+        "deb",
+        "rpm"
       ]
       ]
     },
     },
     "mac": {
     "mac": {

+ 2 - 2
server/src/collections/collections.service.ts

@@ -164,11 +164,11 @@ export class CollectionsService {
         });
         });
 
 
         const autoID = collectionInfo.schema.fields.find(
         const autoID = collectionInfo.schema.fields.find(
-          (v) => v.is_primary_key === true
+          v => v.is_primary_key === true
         )?.autoID;
         )?.autoID;
 
 
         const loadCollection = loadedCollections.data.find(
         const loadCollection = loadedCollections.data.find(
-          (v) => v.name === name
+          v => v.name === name
         );
         );
 
 
         const loadedPercentage = !loadCollection
         const loadedPercentage = !loadCollection