-
Notifications
You must be signed in to change notification settings - Fork 17
fix: incorrect storage group count #2653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,6 +2,11 @@ import {Flex} from '@gravity-ui/uikit'; | |||||
| import {Link, useLocation} from 'react-router-dom'; | ||||||
|
|
||||||
| import {parseQuery} from '../../../../../routes'; | ||||||
| import { | ||||||
| useCapabilitiesLoaded, | ||||||
| useStorageGroupsHandlerAvailable, | ||||||
| } from '../../../../../store/reducers/capabilities/hooks'; | ||||||
| import {storageApi} from '../../../../../store/reducers/storage/storage'; | ||||||
| import {TENANT_METRICS_TABS_IDS} from '../../../../../store/reducers/tenant/constants'; | ||||||
| import type {TenantMetricsTab} from '../../../../../store/reducers/tenant/types'; | ||||||
| import type { | ||||||
|
|
@@ -11,7 +16,7 @@ import type { | |||||
| } from '../../../../../store/reducers/tenants/utils'; | ||||||
| import {cn} from '../../../../../utils/cn'; | ||||||
| import {SHOW_NETWORK_UTILIZATION} from '../../../../../utils/constants'; | ||||||
| import {useSetting, useTypedSelector} from '../../../../../utils/hooks'; | ||||||
| import {useAutoRefreshInterval, useSetting, useTypedSelector} from '../../../../../utils/hooks'; | ||||||
| import {calculateMetricAggregates} from '../../../../../utils/metrics'; | ||||||
| import { | ||||||
| formatCoresLegend, | ||||||
|
|
@@ -27,6 +32,7 @@ import './MetricsTabs.scss'; | |||||
| const b = cn('tenant-metrics-tabs'); | ||||||
|
|
||||||
| interface MetricsTabsProps { | ||||||
| tenantName: string; | ||||||
| poolsCpuStats?: TenantPoolsStats[]; | ||||||
| memoryStats?: TenantMetricStats[]; | ||||||
| blobStorageStats?: TenantStorageStats[]; | ||||||
|
|
@@ -35,6 +41,7 @@ interface MetricsTabsProps { | |||||
| } | ||||||
|
|
||||||
| export function MetricsTabs({ | ||||||
| tenantName, | ||||||
| poolsCpuStats, | ||||||
| memoryStats, | ||||||
| blobStorageStats, | ||||||
|
|
@@ -45,6 +52,25 @@ export function MetricsTabs({ | |||||
| const {metricsTab} = useTypedSelector((state) => state.tenant); | ||||||
| const queryParams = parseQuery(location); | ||||||
|
|
||||||
| // Fetch storage groups data to get correct count (only if groups handler available) | ||||||
| const capabilitiesLoaded = useCapabilitiesLoaded(); | ||||||
| const groupsHandlerAvailable = useStorageGroupsHandlerAvailable(); | ||||||
| const [autoRefreshInterval] = useAutoRefreshInterval(); | ||||||
|
|
||||||
| const {currentData: storageGroupsData} = storageApi.useGetStorageGroupsInfoQuery( | ||||||
| { | ||||||
| tenant: tenantName, | ||||||
| shouldUseGroupsHandler: groupsHandlerAvailable, | ||||||
| with: 'all', | ||||||
| limit: 0, | ||||||
|
||||||
| limit: 0, | |
| limit: NO_LIMIT, |
Outdated
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using an empty array for fieldsRequired when only the total count is needed may result in unnecessary data transfer. Consider if there's a more specific way to request only count data.
| fieldsRequired: [], | |
| fieldsRequired: ['count'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have
StorageGroupsinside tenant data, there is no need to use storage handlerhttps://github.com/ydb-platform/ydb-embedded-ui/blob/main/src/types/api/tenant.ts#L56