-
Notifications
You must be signed in to change notification settings - Fork 0
Resource accounting #51
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
base: main
Are you sure you want to change the base?
Conversation
✱ Stainless preview buildsThis PR will update the Edit this comment to update it. It will appear in the SDK's changelogs.
|
⚠️ hypeman-go studio · code · diff
There was a regression in your SDK.
generate ⚠️(prev:generate ✅) →lint ✅→test ✅go get github.com/stainless-sdks/hypeman-go@4b445ea68c73debc7c08db3f1f8eed88c94f405aNew diagnostics (1 warning)
⚠️ Endpoint/NotConfigured: `get /resources` exists in the OpenAPI spec, but isn't specified in the Stainless config, so code will not be generated for it.
⚠️ hypeman-cli studio · conflict
There was a regression in your SDK.
New diagnostics (1 warning)
⚠️ Endpoint/NotConfigured: `get /resources` exists in the OpenAPI spec, but isn't specified in the Stainless config, so code will not be generated for it.
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push.
Last updated: 2025-12-26 04:51:11 UTC
| default: | ||
| return fmt.Sprintf("%dbit", bitsPerSec) | ||
| } | ||
| } |
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.
Network rate formatting truncates bandwidth values significantly
The formatTcRate function uses integer division to convert bandwidth to tc rate strings, which silently truncates non-round values. For example, when the proportional bandwidth calculation yields 2.5 Gbps (312,500,000 bytes/sec), the function converts to 2,500,000,000 bits/sec, then divides by 1,000,000,000 resulting in "2gbit" instead of "2500mbit". This is a 20% reduction in actual bandwidth applied. Since DefaultNetworkBandwidth commonly produces non-round gigabit values (e.g., (vcpus * effectiveNet) / cpuCapacity), VMs will often receive significantly less bandwidth than calculated. The fix is to use the smaller unit (mbit) when the value isn't evenly divisible by the larger unit.
Note
Adds resource accounting and enforcement across CPU, memory, disk, and network.
lib/resourceswith discovery, oversubscription, per-instance allocations, and default limit calculators; integrated via wire andApiService/resourcesendpoint (OpenAPI + server) returningResourceswithResourceStatus,DiskBreakdown, and per-instance allocationsnetwork.bandwidth_download/bandwidth_uploadanddisk_io_bps; defaults auto-calculated from CPU share; values echoed inInstancemake test VERBOSE=1flagWritten by Cursor Bugbot for commit c1641a5. This will update automatically on new commits. Configure here.