traas-stack / chaosmeta

A chaos engineering platform for supporting the complete fault drill lifecycle.
https://chaosmeta.gitbook.io/chaosmeta-cn
Apache License 2.0
318 stars 55 forks source link

Bug: Unable to perform memory fill by "bytes" #84

Closed cycwll closed 10 months ago

cycwll commented 11 months ago

pod-->mem --> fill Due to the limitations on the front end of the page, percentage is required and must be between 1 and 100, and cannot be 0. And once percent= 0, the number of injected bytes will be calculated based on percentage (source code chaosmetad pkg/utils/memory/mem. go). This results in the inability to specify a fixed byte value。

由于页面前端限制了 percent 为必填项,并且必须为1-100之间,不能为0。一旦 percent !=0 ,就会按percent计算注入的bytes数,(源码chaosmetad pkg/utils/memory/mem.go 34行)。从而导致无法指定一个固定的 bytes 值,或者说指定了也无效,因为percent不能填0。

image

另外,我个人觉得对于pod来说,这里的 percent 没什么实际意义,因为percent是按宿主机的内存指标计算的,与pod的request和limit都没有关系。这里的逻辑是否应该完善一下?不知道我的理解是否正确,还是这个设计是针对某特定场景而考虑的。

KingsonKai commented 10 months ago

fix in v0.6.0