fix: job rate limit (#409)

Signed-off-by: zhaoxinxin <1186037180@qq.com>
This commit is contained in:
Zhaoxinxin 2024-11-11 13:48:18 +08:00 committed by GitHub
parent 3b99678fee
commit dded1e4c11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 22 additions and 22 deletions

View File

@ -151,7 +151,7 @@ describe('Update cluster', () => {
cy.get('#peerLoadLimit').should('have.value', 0);
cy.get('#candidateParentLimit').should('have.value', 0);
cy.get('#filterParentLimit').should('have.value', 0);
cy.get('#jobRateLimit').should('have.value', 0);
cy.get('#jobRateLimit').should('have.value', 10);
});
it('can update cluster', () => {

View File

@ -1,5 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" class="icon" viewBox="0 0 1024 1024">
<path fill="#00a76f"
<path fill="#2e8f79"
d="M888 680h-54V540H546v-92h238c8.8 0 16-7.2 16-16V168c0-8.8-7.2-16-16-16H240c-8.8 0-16 7.2-16 16v264c0 8.8 7.2 16 16 16h238v92H190v140h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8h-54v-72h220v72h-54c-4.4 0-8 3.6-8 8v176c0 4.4 3.6 8 8 8h176c4.4 0 8-3.6 8-8V688c0-4.4-3.6-8-8-8zM256 805.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zm288 0c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7zM288 384V216h448v168H288zm544 421.3c0 1.5-1.2 2.7-2.7 2.7h-58.7c-1.5 0-2.7-1.2-2.7-2.7v-58.7c0-1.5 1.2-2.7 2.7-2.7h58.7c1.5 0 2.7 1.2 2.7 2.7v58.7z" />
<path fill="#00a76f" d="M360 300a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" />
<path fill="#2e8f79" d="M360 300a40 40 0 1 0 80 0 40 40 0 1 0-80 0Z" />
</svg>

Before

Width:  |  Height:  |  Size: 1017 B

After

Width:  |  Height:  |  Size: 1017 B

View File

@ -2,11 +2,11 @@
width="64" height="64">
<path
d="M1105.829941 959.086308a61.926477 61.926477 0 0 0-18.799109-44.970418l-89.572225-89.572225a63.400917 63.400917 0 1 0-88.097785 91.046665l89.572225 89.940836a63.032307 63.032307 0 0 0 44.970418 18.430499 64.506747 64.506747 0 0 0 44.970417-18.430499 61.926477 61.926477 0 0 0 16.956059-46.444858z"
fill="#00a76f" p-id="9163"></path>
fill="#2e8f79" p-id="9163"></path>
<path
d="M25.434089 584.947178a25.065479 25.065479 0 0 1-25.434089-24.328259 26.171309 26.171309 0 0 1 25.434089-25.802698H140.071793l112.794654-190.20275a25.434089 25.434089 0 0 1 34.649338-9.21525 23.591039 23.591039 0 0 1 9.215249 8.84664l110.582994 176.19557 54.922887-57.503157a25.434089 25.434089 0 0 1 36.860998 0 22.853819 22.853819 0 0 1 5.52915 8.10942l63.769527 128.276273 78.882536-331.748982a25.434089 25.434089 0 0 1 30.963238-18.799109 23.959649 23.959649 0 0 1 12.164129 7.003589l116.112144 117.586584a26.060726 26.060726 0 0 1-36.860998 36.860998l-83.674465-84.411685-84.780296 356.814461a22.853819 22.853819 0 0 1-13.638569 16.956059 24.696869 24.696869 0 0 1-33.174898-9.21525v-1.84305l-78.882536-159.976731-51.974008 53.817057a15.850229 15.850229 0 0 1-5.897759 5.16054 25.802699 25.802699 0 0 1-36.860998-8.10942l-105.422455-172.509471-98.418864 165.137272a23.959649 23.959649 0 0 1-22.485209 13.638569z"
fill="#00a76f" p-id="9164"></path>
fill="#2e8f79" p-id="9164"></path>
<path
d="M583.140989 1.437579a462.605525 462.605525 0 0 0-396.255729 170.666421 32.437678 32.437678 0 0 0 25.802699 52.711227 32.806288 32.806288 0 0 0 25.434088-12.532739c8.47803-10.321079 17.693279-20.273549 27.277139-30.226019a399.941829 399.941829 0 0 1 565.0791 0A399.573219 399.573219 0 1 1 265.399186 747.135569c-9.583859-9.952469-18.799109-19.904939-27.277139-30.594628a32.806288 32.806288 0 0 0-25.434088-12.532739 32.437678 32.437678 0 0 0-25.802699 52.711227c10.321079 12.532739 21.010769 24.696869 32.437678 36.860998A464.448575 464.448575 0 1 0 583.140989 1.437579z"
fill="#00a76f" p-id="9165"></path>
fill="#2e8f79" p-id="9165"></path>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -2,8 +2,8 @@
width="64" height="64">
<path
d="M224 800.256L223.712 224H320v31.68c0 35.456 28.64 64.32 63.872 64.32h256.256A64.16 64.16 0 0 0 704 255.68V224l96-0.256L800.256 800 224 800.256zM640 192.32L640.128 256 384 255.68V192.32L383.872 192 640 192.32zM799.84 160H695.04c-11.072-19.04-31.424-32-54.912-32h-256.256c-23.488 0-43.808 12.928-54.912 32H223.712A63.776 63.776 0 0 0 160 223.744v576.512C160 835.392 188.608 864 223.744 864h576.512A63.84 63.84 0 0 0 864 800.256V223.744A64 64 0 0 0 799.84 160z"
fill="#00a76f" p-id="2332"></path>
fill="#2e8f79" p-id="2332"></path>
<path
d="M619.072 429.088l-151.744 165.888-62.112-69.6a32 32 0 1 0-47.744 42.624l85.696 96a32 32 0 0 0 23.68 10.688h0.192c8.96 0 17.536-3.776 23.616-10.4l175.648-192a32 32 0 0 0-47.232-43.2"
fill="#00a76f" p-id="2333"></path>
fill="#2e8f79" p-id="2333"></path>
</svg>

Before

Width:  |  Height:  |  Size: 924 B

After

Width:  |  Height:  |  Size: 924 B

View File

@ -4,5 +4,5 @@
xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64">
<path
d="M318.592 819.2L17.088 512l301.44-307.2 45.568 45.504L96.64 512l267.392 261.696-45.504 45.504z m386.816 0l-45.504-45.504L927.296 512 659.84 250.304l45.504-45.504L1006.912 512l-301.44 307.2zM540.8 221.888l55.68 11.136-113.28 569.088-55.808-11.072L540.8 221.888z"
fill="#00a76f" p-id="25173"></path>
fill="#2e8f79" p-id="25173"></path>
</svg>

Before

Width:  |  Height:  |  Size: 665 B

After

Width:  |  Height:  |  Size: 665 B

View File

@ -2,5 +2,5 @@
width="200" height="200">
<path
d="M512 74.666667C270.933333 74.666667 74.666667 270.933333 74.666667 512S270.933333 949.333333 512 949.333333 949.333333 753.066667 949.333333 512 753.066667 74.666667 512 74.666667zM288 810.666667c0-123.733333 100.266667-224 224-224S736 686.933333 736 810.666667c-61.866667 46.933333-140.8 74.666667-224 74.666666s-162.133333-27.733333-224-74.666666z m128-384c0-53.333333 42.666667-96 96-96s96 42.666667 96 96-42.666667 96-96 96-96-42.666667-96-96z m377.6 328.533333c-19.2-96-85.333333-174.933333-174.933333-211.2 32-29.866667 51.2-70.4 51.2-117.333333 0-87.466667-72.533333-160-160-160s-160 72.533333-160 160c0 46.933333 19.2 87.466667 51.2 117.333333-89.6 36.266667-155.733333 115.2-174.933334 211.2-55.466667-66.133333-91.733333-149.333333-91.733333-243.2 0-204.8 168.533333-373.333333 373.333333-373.333333S885.333333 307.2 885.333333 512c0 93.866667-34.133333 177.066667-91.733333 243.2z"
fill="#00a76f" p-id="8273"></path>
fill="#2e8f79" p-id="8273"></path>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -57,13 +57,13 @@ export default function EditCluster() {
scheduler_cluster_config: {
candidate_parent_limit: 0,
filter_parent_limit: 0,
job_rate_limit: 0,
job_rate_limit: 10,
},
seed_peer_cluster_config: {
load_limit: 0,
load_limit: 2000,
},
peer_cluster_config: {
load_limit: 0,
load_limit: 200,
},
created_at: '',
updated_at: '',
@ -529,7 +529,7 @@ export default function EditCluster() {
type: 'number',
autoComplete: 'family-name',
placeholder: 'Please enter Job Rate Limit',
value: job_rate_limit,
value: job_rate_limit || 10,
helperText: jobRateLimitError ? 'Fill in the number, the length is 1-1000000.' : '',
error: jobRateLimitError,
@ -547,7 +547,7 @@ export default function EditCluster() {
InputProps: {
endAdornment: (
<Tooltip
title={`The scheduler will randomly select the number of parents from all the parents according to the filter parent limit and evaluate the optimal parents in selecting parents for the peer to download task. The number of optimal parent is the scheduling parent limit.`}
title={`The rate limit(requests per second) for job Open API, default value is 10.`}
placement="top"
>
<HelpIcon color="disabled" className={styles.descriptionIcon} />

View File

@ -763,7 +763,7 @@ export default function Information(props: { cluster: getClusterResponse; isLoad
</Box>
) : (
<Typography id="filter-parent-limit" component="div">
{cluster?.scheduler_cluster_config?.job_rate_limit || 0}
{cluster?.scheduler_cluster_config?.job_rate_limit || 10}
</Typography>
)}
</Box>

View File

@ -276,11 +276,11 @@ export default function Layout(props: any) {
sx={{
'&.Mui-selected': {
backgroundColor: 'var(--menu-background-color)',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
'&.Mui-selected:hover': {
backgroundColor: 'var(--hover-menu-background-color)',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
height: '2.6rem',
borderRadius: '0.2rem',
@ -304,11 +304,11 @@ export default function Layout(props: any) {
sx={{
'&.Mui-selected': {
backgroundColor: '#fff',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
'&.Mui-selected:hover': {
backgroundColor: '#fff',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
height: '2.4rem',
borderRadius: '0.2rem',
@ -335,11 +335,11 @@ export default function Layout(props: any) {
sx={{
'&.Mui-selected': {
backgroundColor: 'var(--menu-background-color)',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
'&.Mui-selected:hover': {
backgroundColor: 'var(--hover-menu-background-color)',
color: 'var(--menu-color)',
color: 'var(--description-color)',
},
height: '2.6rem',
borderRadius: '0.2rem',