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
networkStats
arrays to simple primitive values (networkUtilization
andnetworkThroughput
as numbers), aligning with how cluster network metrics are handled.TabCard Component Splitting: Decomposed the monolithic
TabCard
component 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
calculateTenantMetrics
utility 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
networkUtilization
andnetworkThroughput
values instead of combinednetworkStats
formatStorageLegend
which may be semantically incorrectConfidence score: 4/5
formatStorageLegend
for memory metrics - consider renaming the formatter for better semantic claritySequence Diagram
Context 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