fix: write network info for tenant same as for cluster #2882
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2880
Stand
Greptile Summary
Updated On: 2025-09-12 16:25:55 UTC
This PR addresses issue #2880 by standardizing network information display between tenant and cluster views through a comprehensive architectural refactoring. The changes transform the MetricsTabs system from using composite wrapper components to individual modular tab components, creating better maintainability and consistency.
Key Architectural Changes:
Component Modularization: Replaced composite wrapper components (
CommonMetricsTabs,DedicatedMetricsTabs,ServerlessPlaceholderTabs) with individual tab components (CpuTab,MemoryTab,NetworkTab,StorageTab,PlaceholderTab) that can be composed directly.Network Data Structure Simplification: Changed from passing complex
networkStatsarrays to simple primitive values (networkUtilizationandnetworkThroughputas numbers), aligning with how cluster network metrics are handled.TabCard Component Splitting: Decomposed the monolithic
TabCardcomponent into three focused components:UsageTabCard: For value/limit metrics with doughnut chartsUtilizationTabCard: For percentage-based metricsServerlessTabCard: For placeholder content in serverless tenantsData Layer Updates: Modified
calculateTenantMetricsutility to expose raw network values instead of computed composite statistics, giving UI components more flexibility in how they display network information.The refactoring maintains all existing functionality while creating a more maintainable codebase. Network tabs now use the same data patterns as cluster views, with proper fallbacks to placeholder tabs when network data is unavailable. The new architecture follows React best practices with proper memoization, clean prop interfaces, and separation of concerns between different metric types.
Important Files Changed
Changed Files
networkUtilizationandnetworkThroughputvalues instead of combinednetworkStatsformatStorageLegendwhich may be semantically incorrectConfidence score: 4/5
formatStorageLegendfor memory metrics - consider renaming the formatter for better semantic claritySequence Diagram
sequenceDiagram participant User participant TenantOverview participant tenantApi participant calculateTenantMetrics participant MetricsTabs participant NetworkTab participant UtilizationTabCard User->>TenantOverview: "Navigate to tenant overview" TenantOverview->>tenantApi: "useGetTenantInfoQuery(tenantName, clusterName)" tenantApi-->>TenantOverview: "Return tenant data with NetworkUtilization, NetworkWriteThroughput" TenantOverview->>calculateTenantMetrics: "calculateTenantMetrics(tenantData)" calculateTenantMetrics-->>TenantOverview: "Return networkUtilization, networkThroughput" TenantOverview->>MetricsTabs: "Render with networkUtilization, networkThroughput props" MetricsTabs->>MetricsTabs: "renderNetworkTab() - check showNetworkUtilization setting" alt showNetworkUtilization enabled and not serverless MetricsTabs->>NetworkTab: "Render with networkUtilization, networkThroughput" NetworkTab->>NetworkTab: "Check if networkUtilization and networkThroughput are valid" alt Valid network data NetworkTab->>UtilizationTabCard: "Render with fillPercent and legendText" UtilizationTabCard-->>User: "Display network utilization card with doughnut chart" else Invalid network data NetworkTab-->>User: "Display PlaceholderTab" end else showNetworkUtilization disabled or serverless MetricsTabs-->>User: "No network tab rendered" endContext used:
Style Guide - description of repository for agents (link)
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: ✅
Current: 85.43 MB | Main: 85.43 MB
Diff: +4.20 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information