Skip to content

Commit

Permalink
update radix cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Jun 14, 2024
1 parent db4b5c6 commit 7f8bd02
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 48 deletions.
53 changes: 10 additions & 43 deletions src/components/page-active-component/horizontal-scaling-summary.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Accordion, Typography } from '@equinor/eds-core-react';
import { isNil } from 'lodash';
import * as PropTypes from 'prop-types';
import { FunctionComponent } from 'react';
import { Fragment, FunctionComponent } from 'react';

import { HorizontalScalingSummary as HorizontalScalingSummaryModel } from '../../store/radix-api';

Expand Down Expand Up @@ -38,49 +38,16 @@ export const HorizontalScalingSummary: FunctionComponent<
</>
)}

{!isNil(data.currentCPUUtilizationPercentage) && (
<>
<Typography as="dt">
CPU utilization, current average:
</Typography>
<Typography as="dd" variant="body_short_bold">
{data.currentCPUUtilizationPercentage}%
</Typography>
</>
)}

{!isNil(data.targetCPUUtilizationPercentage) && (
<>
<Typography as="dt">
CPU utilization, target average:
</Typography>
<Typography as="dd" variant="body_short_bold">
{data.targetCPUUtilizationPercentage}%
</Typography>
</>
)}

{!isNil(data.currentMemoryUtilizationPercentage) && (
<>
<Typography as="dt">
Memory utilization, current average:
</Typography>
<Typography as="dd" variant="body_short_bold">
{data.currentMemoryUtilizationPercentage}%
{data.triggers.map((trigger, i) => (
<Fragment key={trigger.name + i}>
<Typography as="dt">{trigger.name}:</Typography>
<Typography as="dd">
<strong>{trigger.current_utilization}%</strong> of{' '}
<strong>{trigger.target_utilization}% </strong>
target utilization
</Typography>
</>
)}

{!isNil(data.targetMemoryUtilizationPercentage) && (
<>
<Typography as="dt">
Memory utilization, target average:
</Typography>
<Typography as="dd" variant="body_short_bold">
{data.targetMemoryUtilizationPercentage}%
</Typography>
</>
)}
</Fragment>
))}
</dl>
</div>
</Accordion.Panel>
Expand Down
10 changes: 5 additions & 5 deletions src/store/radix-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2216,19 +2216,19 @@ export type HorizontalScalingSummaryTriggerStatus = {
export type HorizontalScalingSummary = {
/** CooldownPeriod in seconds. From radixconfig.yaml */
cooldownPeriod?: number;
/** Component current average CPU utilization over all pods, represented as a percentage of requested CPU */
/** Deprecated: Component current average CPU utilization over all pods, represented as a percentage of requested CPU. Use Triggers instead. Will be removed from Radix API 2025-01-01. */
currentCPUUtilizationPercentage?: number;
/** Component current average memory utilization over all pods, represented as a percentage of requested memory */
/** Deprecated: Component current average memory utilization over all pods, represented as a percentage of requested memory. Use Triggers instead. Will be removed from Radix API 2025-01-01. */
currentMemoryUtilizationPercentage?: number;
/** Component maximum replicas. From radixconfig.yaml */
maxReplicas?: number;
/** Component minimum replicas. From radixconfig.yaml */
minReplicas?: number;
/** PollingInterval in seconds. From radixconfig.yaml */
pollingInterval?: number;
/** Component target average CPU utilization over all pods */
/** Deprecated: Component target average CPU utilization over all pods. Use Triggers instead. Will be removed from Radix API 2025-01-01. */
targetCPUUtilizationPercentage?: number;
/** Component target average memory utilization over all pods */
/** Deprecated: Component target average memory utilization over all pods. use Triggers instead. Will be removed from Radix API 2025-01-01. */
targetMemoryUtilizationPercentage?: number;
/** Triggers lists status of all triggers found in radixconfig.yaml */
triggers?: HorizontalScalingSummaryTriggerStatus[];
Expand Down Expand Up @@ -2350,7 +2350,7 @@ export type Component = {
ports?: Port[];
/** Array of ReplicaSummary */
replicaList?: ReplicaSummary[];
/** Array of pod names */
/** Deprecated: Array of pod names. Use ReplicaList instead */
replicas?: string[];
resources?: ResourceRequirements;
/** ScheduledJobPayloadPath defines the payload path, where payload for Job Scheduler will be mapped as a file. From radixconfig.yaml */
Expand Down

0 comments on commit 7f8bd02

Please sign in to comment.