-
Notifications
You must be signed in to change notification settings - Fork 128
Cpusets support #782
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
Cpusets support #782
Conversation
316e435
to
c5fcaff
Compare
c5fcaff
to
1230c1b
Compare
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.
Reviewable status: 0 of 2 approvals obtained (waiting on @jellonek)
pkg/utils/strings.go, line 41 at r1 (raw file):
// Stringify returns string representation for provided value. func Stringify(value interface{}) (string, error) {
Perhaps can just use fmt.Sprintf("%v", value)
instead?
pkg/utils/cgroups/controllers.go, line 36 at r1 (raw file):
// GetProcessControllers returns mapping between controller types and theirs // paths inside cgroups fs mount for particular process identificator
Returns the mapping between controller types and their paths inside cgroup fs for the specified PID
pkg/utils/cgroups/controllers.go, line 76 at r1 (raw file):
} // Controller represents named controller for particular process
Controller represents a named controller for a process
pkg/utils/cgroups/controllers.go, line 82 at r1 (raw file):
} // GetProcessController returns named resource Controller for given process identificator
returns a named resource controller for the specified PID
pkg/utils/cgroups/controllers.go, line 105 at r1 (raw file):
} // Set sets value for particular setting using this controller
Set sets the value of a controller setting
1230c1b
to
b603742
Compare
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.
Reviewable status: 1 change requests, 0 of 2 approvals obtained (waiting on @jellonek and @ivan4th)
pkg/utils/strings.go, line 41 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
Perhaps can just use
fmt.Sprintf("%v", value)
instead?
That would succeed always. With my version you have additional validation if correct type was passed.
Maybe in fact simpler version would be better as this check is done on runtime, not on compile time. WDYT?
pkg/utils/cgroups/controllers.go, line 36 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
Returns the mapping between controller types and their paths inside cgroup fs for the specified PID
Done.
pkg/utils/cgroups/controllers.go, line 76 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
Controller represents a named controller for a process
Done.
pkg/utils/cgroups/controllers.go, line 82 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
returns a named resource controller for the specified PID
Done.
pkg/utils/cgroups/controllers.go, line 105 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
Set sets the value of a controller setting
Done.
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.
Reviewable status: 1 change requests, 0 of 2 approvals obtained (waiting on @jellonek)
pkg/utils/strings.go, line 41 at r1 (raw file):
Previously, jellonek (Piotr Skamruk) wrote…
That would succeed always. With my version you have additional validation if correct type was passed.
Maybe in fact simpler version would be better as this check is done on runtime, not on compile time. WDYT?
In this case neither the func name (which is quite important) nor its description tells about what value type is expected. I'd go with plain fmt.Sprintf(). If this func needs to be kept (it still needs another name, like StringifySomeKindOfValue), it still can be done via fmt.Sprintf()
with some kind of type check in place.
BTW, the current impl checks the type during runtime. You can only do compile-time checking by making several funcs for different types (as there's no func overloading in Go)
b603742
to
9416c4f
Compare
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.
Reviewable status: 1 change requests, 0 of 2 approvals obtained (waiting on @ivan4th)
pkg/utils/strings.go, line 41 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
In this case neither the func name (which is quite important) nor its description tells about what value type is expected. I'd go with plain fmt.Sprintf(). If this func needs to be kept (it still needs another name, like StringifySomeKindOfValue), it still can be done via
fmt.Sprintf()
with some kind of type check in place.BTW, the current impl checks the type during runtime. You can only do compile-time checking by making several funcs for different types (as there's no func overloading in Go)
I understand that it's done on runtime (it's in second part of my comment).
Ok, changed that to simple fmt.Sprintf without type checking as lack of stringer interface implementation on particular interface simply should not occur.
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.
Reviewed 4 of 6 files at r1, 2 of 2 files at r2.
Reviewable status: 1 change requests, 0 of 2 approvals obtained (waiting on @ivan4th)
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.
Reviewable status: 1 of 2 approvals obtained
This change is