-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
Remove uneeded syntax #21921
Remove uneeded syntax #21921
Conversation
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.
LGTM
Given that this PR got out of sync already once, the benefit of keeping it in sync is less that the actual gains of this small syntactic sugar simplification changes. Would you mind reviewing @fjl @karalabe @holiman 🙏 . |
metrics/cpu_syscall.go
Outdated
@@ -31,5 +31,5 @@ func getProcessCPUTime() int64 { | |||
log.Warn("Failed to retrieve CPU time", "err", err) | |||
return 0 | |||
} | |||
return int64(usage.Utime.Sec+usage.Stime.Sec)*100 + int64(usage.Utime.Usec+usage.Stime.Usec)/10000 //nolint:unconvert | |||
return usage.Utime.Sec + usage.Stime.Sec*100 + int64(usage.Utime.Usec+usage.Stime.Usec)/10000 //nolint:unconvert |
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.
You messed up the math, parenthesis was needed
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.
Ouch, Fixed! 🙏
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.
LGTM
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.
LGTM thx!
Nitpicky Small Changes