-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
Fix max number of samples in experiments on non-64-bit systems. #528
Conversation
Additional context: I ran into this issue after making this benchmarking-related PR on kubernetes-sigs/cri-tools, which has an automated GitHub action which builds that project's binaries which failed to compile. Weirdly enough, this is not an issue on any other non-GitHub system I tested it on (namely x64-based Linux, Windows, and macOS), so I suspect it's related to either the images/hosts used for the GitHub runners, or the way the |
@onsi could I please get a quick lookthrough? (the code itself is trivial) |
hey @aznashwan sorry for the delay. On the whole this looks fine; though I'm a bit surprised to see that this is an issue - are you actually intending to run Also - it's cool to see |
@onsi thank you so much for taking your time to check the linked PR as well!
The root cause of the issue is that Presuming we're on a 32-bit system, the As a result, we need to ensure any comparisons between
Side-note: although this issue should never manifest itself on any CPU >=64bits, as mentioned, it does consistently happen on the GitHub-hosted job runners (which I've double-checked and claim they're 64-bit OSes on x64 CPUs), so I suspect there's something special going on with the base images used for these runners or the way Go is configured within them.
Seriously, thanks again for taking the time to parse the linked PR too! TL;DR: we plan to also record system-related metrics (e.g. CPU/RAM/io etc) associated with each individual measurement, and we'd like to try to do it in a manner which would not interfere with the tests at all by having the system-related queries happen outside of the test itself. (hence why all the sending results to a channel on a different goroutine shenanigans) Full context: We're focusing on benchmarking lifecycle operation durations against CRI-compatible container runtimes, which basically means the CRUD operations for a given resource. (just containers and pods for now) I had actually "inherited" the code which eventually became that PR from a colleague of mine who was initially using The problem was that if we'd run multiple tests in parallel, we would NOT have any grouping of the operation measurements. (i.e. the 3rd I realize there were workarounds we could have done to still use The only real suggestion I could give is that I believe it would be useful if there was some sort of "namespacing of Many thanks again for everything! |
Ah got it - thanks for clarifying. I think I was moving too quickly and didn't appreciate that this is, at the core, a compilation issue. We can go with the It's super cool to see your use case - thanks for sharing it.
I think that usecase is covered with the Annotation decorator but I may have misunderstood. In any event, I don't want to block you. Let me know what you think about the |
The use of `math.MaxInt64` as the maximum number of samples in the context of general int variables can lead to inconsistent behavior on non-64-bit systems. This patch addresses this by using `math.MaxInt32` as the default sample size in case an explicit one is not provided in the `SamplingConfig`. Signed-off-by: Nashwan Azhari <[email protected]>
13b6c1e
to
c2b3449
Compare
@onsi thanks a lot for the follow-up!
You're absolutely right, I've just reverted the PR to simply using
Great call, using those annotations to "tag" values with the lifecycle they represent (e.g. |
sweet! thanks for your patience. will pull this in and cut a new release soon |
Thank you so much as well for all your interest in how the library is used, you really went above and beyond! Hope to be contributing back something more relevant to the project some day soon! |
❤️thanks @aznashwan ! |
The use of
math.MaxInt64
as the maximum number of samples in the contextof general int variables can lead to inconsistent behavior on non-64-bit
systems.
This patch addresses this using the arbitrary-precision
math/big.Int
type to store and compare sampling numbers to ensure no
architecture-dependant int size mismatches will occur.
Signed-off-by: Nashwan Azhari [email protected]