shadcn.io is not affiliated with official shadcn/ui
CPU Utilization Dashboard Block for Radix UI
Seven services as bullet rows on a 0-4 core scale, p95 usage against request and limit, with a headroom slider that recommends new requests and an Apply button that moves every tick.
Installation
Overview
Right-size your CPU requests from what the services really use, with this utilization panel for React with Radix UI. A hairline frame with a plus mark on each corner holds seven Loadstar services as bullet rows on one scale from 0 to 4 cores: a bar for the p95 usage of the last seven days, a solid tick for the request, a grey track out to the limit and a hollow diamond where the recommended request would sit. A service whose p95 is within 10% of its limit reads "Throttled". A Slider sets the headroom from 10 to 50%, and the header says how many services to resize and how many cores that frees. A Shine Button applies the recommendations to the page. It's built from Slider, Badge, Button, Shine Button and Guides. For platform teams and cost reviews.
FAQ
How do I fill it with my services?
Edit SERVICES: an id, a name, and p95, request and limit in millicores. SCALE is the right edge of the bars, and THROTTLE_AT is the share of the limit that counts as throttled. Everything else, the recommendations, the count and the cores freed, is worked out from those numbers.
How is a recommended request worked out?
It is the p95 usage times one plus the headroom, rounded up to 0.1 core and never above the limit. At 25% headroom a service using 1.1 cores gets 1.4. A service already at its recommendation reads "On target", and the header counts only the others.
What does Apply recommendations do?
It moves every request tick to the recommendation for the headroom you had chosen and says how many requests changed. Reset puts the typed requests back. Moving the slider afterwards shows the new recommendations against the applied requests, so you can see what another round would change.