-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(MetricChart): display per pool cpu usage (#769)
- Loading branch information
1 parent
fd6ae9a
commit 6902afa
Showing
4 changed files
with
37 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 15 additions & 6 deletions
21
src/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/cpuDashboardConfig.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
import type {MetricDescription} from '../../../../../components/MetricChart'; | ||
import type {PoolName} from '../../../../../types/api/nodes'; | ||
import type {ChartConfig} from '../TenantDashboard/TenantDashboard'; | ||
import i18n from '../i18n'; | ||
|
||
const pools: PoolName[] = ['IC', 'IO', 'Batch', 'User', 'System']; | ||
|
||
const getPoolMetricConfig = (poolName: PoolName): MetricDescription => { | ||
return { | ||
target: `resources.cpu.${poolName}.usage`, | ||
title: poolName, | ||
}; | ||
}; | ||
|
||
export const cpuDashboardConfig: ChartConfig[] = [ | ||
{ | ||
title: i18n('charts.cpu-usage'), | ||
metrics: [ | ||
{ | ||
target: 'resources.cpu.usage', | ||
title: i18n('charts.cpu-usage'), | ||
}, | ||
], | ||
metrics: pools.map(getPoolMetricConfig), | ||
options: { | ||
dataType: 'percent', | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters