mosn / holmes

self-aware Golang profile dumper
Apache License 2.0
1.08k stars 135 forks source link

log priting is not normal #113

Closed dumbFeng closed 2 years ago

dumbFeng commented 2 years ago

In (*Holmes).EnableDump, the current cpu percent shouldn't be assigned with cpu but curCPU. Like the following code:

func (h *Holmes) EnableDump(curCPU int) (err error) {
    if h.opts.CPUMaxPercent != 0 && curCPU >= h.opts.CPUMaxPercent {
        return fmt.Errorf("current cpu percent [%v] is greater than the CPUMaxPercent [%v]", curCPU, h.opts.CPUMaxPercent)
    }
    return nil
}
Jun10ng commented 2 years ago

Thanks!