feat: add profile filter in benchmark

This commit is contained in:
jialin
2026-03-12 18:51:10 +08:00
parent 61f83f31d7
commit 07fa3c8824
3 changed files with 21 additions and 3 deletions
@@ -5,6 +5,7 @@ import { useIntl } from '@umijs/max';
import { Button, Input, Space } from 'antd'; import { Button, Input, Space } from 'antd';
import _ from 'lodash'; import _ from 'lodash';
import React from 'react'; import React from 'react';
import { profileOptions } from '../config';
export interface RightActionsProps { export interface RightActionsProps {
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void; handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -67,12 +68,29 @@ const RightActions: React.FC<RightActionsProps> = ({
allowClear allowClear
onChange={handleGPUChange} onChange={handleGPUChange}
></Input> ></Input>
<BaseSelect
allowClear
placeholder={intl.formatMessage({
id: 'benchmark.table.filter.byProfile'
})}
style={{ width: 160 }}
options={profileOptions.map((item) => ({
label: intl.formatMessage({ id: item.label }),
value: item.value
}))}
onChange={(value, option) =>
handleQueryChange({
profile: value,
page: 1
})
}
></BaseSelect>
<BaseSelect <BaseSelect
allowClear allowClear
placeholder={intl.formatMessage({ placeholder={intl.formatMessage({
id: 'benchmark.table.filter.bymodel' id: 'benchmark.table.filter.bymodel'
})} })}
style={{ width: 200 }} style={{ width: 180 }}
options={modelOptions} options={modelOptions}
onChange={(value, option) => onChange={(value, option) =>
handleQueryChange({ handleQueryChange({
@@ -32,7 +32,7 @@ const PercentileResult: React.FC = () => {
render: (value: number) => round(value, 2) render: (value: number) => round(value, 2)
}, },
{ {
title: `${intl.formatMessage({ id: 'benchmark.detail.percentile.latency' })} (ms)`, title: `${intl.formatMessage({ id: 'benchmark.detail.percentile.latency' })} (s)`,
dataIndex: 'request_latency', dataIndex: 'request_latency',
render: (value: number) => round(value, 2) render: (value: number) => round(value, 2)
}, },
@@ -143,7 +143,7 @@ const useColumnSettings = (options: {
title: renderTitle( title: renderTitle(
`${intl.formatMessage({ id: 'benchmark.detail.summary.latency' })}`, `${intl.formatMessage({ id: 'benchmark.detail.summary.latency' })}`,
{ {
subTitle: `${intl.formatMessage({ id: 'benchmark.table.avg' })} (ms)` subTitle: `${intl.formatMessage({ id: 'benchmark.table.avg' })} (s)`
} }
), ),
dataIndex: 'request_latency_mean', dataIndex: 'request_latency_mean',