Skip to content

Commit

Permalink
Merge pull request #1749 from milvus-io/upgrade-sizing-tool
Browse files Browse the repository at this point in the history
update form label
  • Loading branch information
ThyeeZz authored Dec 27, 2024
2 parents 950764f + 5f39920 commit 8574b6e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/i18n/en/sizingTool.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"offloading": "Offloading Fields to Disk",
"mmp": "Milvus uses <0>Mmap</0> to enable direct memory access to large files on disk without reading the entire files into memory.",
"indexType": "Index Type",
"withRawData": "With_raw_data",
"m": "M(Maximum degree of the node)",
"withRawData": "with_raw_data",
"m": "m(maximum degree of the node)",
"nlist": "nlist",
"maxDegree": "Max Degree",
"maxDegree": "max_degree",
"segmentSize": "Segment Size",
"dependencyComp": "Dependency Component",
"mode": "Mode",
Expand Down Expand Up @@ -71,8 +71,8 @@
"disk": "Local Disk",
"storage": "Storage",
"podNum": "Pod Number",
"pvc": "Pcv per Pod: <0>{{pvc}} GB</0>",
"pvcLabel": "Pcv per Pod",
"pvc": "Pvc per Pod: <0>{{pvc}} GB</0>",
"pvcLabel": "Pvc per Pod",
"journal": "Journal",
"ledger": "Ledgers",
"config": "{{cpu}} Core {{memory}} GB",
Expand Down
46 changes: 34 additions & 12 deletions src/parts/sizing/indexTypeComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
N_LIST_RANGE_CONFIG,
M_RANGE_CONFIG,
} from '@/consts/sizing';
import { useTranslation } from 'react-i18next';

type IndexTypeComponentProps = {
data: IIndexType;
Expand All @@ -16,11 +17,16 @@ type IndexTypeComponentProps = {

const SCANNComponent = (props: IndexTypeComponentProps) => {
const { data, onChange } = props;
const { t } = useTranslation('sizingTool');

return (
<div className="mt-[20px]">
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>Index Parameters</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>With_raw_data</p>
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>
{t('form.indexType')}
</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>
{t('form.withRawData')}
</p>
<RadioGroup
value={data.widthRawData.toString()}
onValueChange={val => {
Expand All @@ -33,7 +39,7 @@ const SCANNComponent = (props: IndexTypeComponentProps) => {
<p className="">True</p>
</div>
<div className={classes.flexRow}>
<RadioGroupItem value="false">False</RadioGroupItem>
<RadioGroupItem value="false"></RadioGroupItem>
<p className="">False</p>
</div>
</RadioGroup>
Expand All @@ -42,13 +48,14 @@ const SCANNComponent = (props: IndexTypeComponentProps) => {
};

const HNSWComponent = (props: IndexTypeComponentProps) => {
const { t } = useTranslation('sizingTool');
const { data, onChange } = props;
return (
<div className="mt-[20px]">
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>Index Parameters</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>
M(Maximum degree of the node)
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>
{t('form.indexType')}
</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>{t('form.m')}</p>
<SizingRange
rangeConfig={M_RANGE_CONFIG}
value={data.m}
Expand All @@ -62,11 +69,16 @@ const HNSWComponent = (props: IndexTypeComponentProps) => {
};

const DISKANNComponent = (props: IndexTypeComponentProps) => {
const { t } = useTranslation('sizingTool');
const { data, onChange } = props;
return (
<div className="mt-[20px]">
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>Index Parameters</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>nlist</p>
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>
{t('form.indexType')}
</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>
{t('form.maxDegree')}
</p>
<SizingRange
rangeConfig={MAX_NODE_DEGREE_RANGE_CONFIG}
value={data.maxDegree}
Expand All @@ -80,11 +92,16 @@ const DISKANNComponent = (props: IndexTypeComponentProps) => {
};

const IVFFlatComponent = (props: IndexTypeComponentProps) => {
const { t } = useTranslation('sizingTool');
const { data, onChange } = props;
return (
<div className="mt-[20px]">
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>Index Parameters</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>nlist</p>
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>
{t('form.indexType')}
</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>
{t('form.nlist')}
</p>
<SizingRange
rangeConfig={N_LIST_RANGE_CONFIG}
value={data.flatNList}
Expand All @@ -98,11 +115,16 @@ const IVFFlatComponent = (props: IndexTypeComponentProps) => {
};

const IVFSQ8Component = (props: IndexTypeComponentProps) => {
const { t } = useTranslation('sizingTool');
const { data, onChange } = props;
return (
<div className="mt-[20px]">
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>Index Parameters</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>nlist</p>
<p className={clsx(classes.smallerLabel, 'mb-[8px]')}>
{t('form.indexType')}
</p>
<p className={clsx(classes.indexParamLabel, 'mb-[8px]')}>
{t('form.nlist')}
</p>
<SizingRange
rangeConfig={N_LIST_RANGE_CONFIG}
value={data.sq8NList}
Expand Down
2 changes: 1 addition & 1 deletion src/parts/sizing/resultSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default function ResultSection(props: {
// milvus data
const { milvusCpu, milvusMemory } = milvusOverviewDataCalculator(nodeConfig);
const milvusCpuData = formatNumber(milvusCpu);
const milvusMemoryData = unitBYTE2Any(milvusMemory);
const milvusMemoryData = unitBYTE2Any(milvusMemory * 1024 * 1024 * 1024);

// dependency data
const { dependencyCpu, dependencyMemory, dependencyStorage } =
Expand Down

0 comments on commit 8574b6e

Please sign in to comment.