Rapl node capping daemon #21
|
@ -11,3 +11,29 @@ on all worker nodes.
|
|||
![]() capable of changing capable **of** changing
|
||||
--data '{"percentage":75}' \
|
||||
http://localhost:9090/powercap
|
||||
```
|
||||
|
||||
![]() capable of changing capable **of** changing
|
||||
### Payload
|
||||
![]() capable of changing capable **of** changing
|
||||
|
||||
![]() capable of changing capable **of** changing
|
||||
```json
|
||||
![]() capable of changing capable **of** changing
|
||||
{
|
||||
![]() capable of changing capable **of** changing
|
||||
"percentage":75
|
||||
![]() capable of changing capable **of** changing
|
||||
}
|
||||
![]() capable of changing capable **of** changing
|
||||
```
|
||||
![]() capable of changing capable **of** changing
|
||||
|
||||
![]() capable of changing capable **of** changing
|
||||
### Response
|
||||
![]() capable of changing capable **of** changing
|
||||
|
||||
![]() capable of changing capable **of** changing
|
||||
The daemon will respond with a json payload containing zones that were
|
||||
![]() capable of changing capable **of** changing
|
||||
successfully capped as well as the zones that were not capped.
|
||||
![]() capable of changing capable **of** changing
|
||||
|
||||
![]() capable of changing capable **of** changing
|
||||
```json
|
||||
![]() capable of changing capable **of** changing
|
||||
{
|
||||
![]() capable of changing capable **of** changing
|
||||
"cappedZones": null,
|
||||
![]() capable of changing capable **of** changing
|
||||
"failedZones": [
|
||||
![]() capable of changing capable **of** changing
|
||||
"intel-rapl:0",
|
||||
![]() capable of changing capable **of** changing
|
||||
"intel-rapl:1"
|
||||
![]() capable of changing capable **of** changing
|
||||
],
|
||||
![]() capable of changing capable **of** changing
|
||||
"error": "some zones were not able to be powercapped"
|
||||
![]() capable of changing capable **of** changing
|
||||
}
|
||||
![]() capable of changing capable **of** changing
|
||||
```
|
||||
![]() capable of changing capable **of** changing
|
||||
|
||||
![]() capable of changing capable **of** changing
|
||||
Field error will not exist if failed zones is empty.
|
||||
![]() capable of changing capable **of** changing
|
|
@ -15,6 +15,13 @@ type Cap struct {
|
|||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
Percentage int
|
||||
}
|
||||
|
||||
// CapResponse is the payload sent with information about the capping call
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
type CapResponse struct {
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
CappedZones []string `json:"cappedZones"`
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
FailedZones []string `json:"failedZones"`
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
Error *string `json:"error"`
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
}
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
func main() {
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprintf(w, "Unsupported endpoint %s", html.EscapeString(r.URL.Path))
|
||||
![]() error messages should be lowercase. error messages should be lowercase.
![]() In this case this is some http content being served back to to the client that made the request. I did make it lower case though. In this case this is some http content being served back to to the client that made the request. I did make it lower case though.
|
||||
|
@ -26,19 +33,28 @@ func main() {
|
|||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
|
||||
// Handler for the powercapping HTTP API endpoint.
|
||||
func powercapEndpoint(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
var payload Cap
|
||||
var response CapResponse
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
decoder := json.NewDecoder(r.Body)
|
||||
err := decoder.Decode(&payload)
|
||||
if err != nil {
|
||||
http.Error(w, "error parsing payload: "+err.Error(), 400)
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
errorMsg := "error parsing payload: " + err.Error()
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
response.Error = &errorMsg
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
json.NewEncoder(w).Encode(response)
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
return
|
||||
}
|
||||
|
||||
err = capNode(powercapDir, payload.Percentage)
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
cappedZones, failedZones, err := capNode(powercapDir, payload.Percentage)
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), 400)
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
return
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
errorMsg := err.Error()
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
response.Error = &errorMsg
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
}
|
||||
|
||||
fmt.Fprintf(w, "capped node at %d percent", payload.Percentage)
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
response.CappedZones = cappedZones
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
response.FailedZones = failedZones
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
json.NewEncoder(w).Encode(response)
|
||||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
||||
}
|
||||
|
|
|||
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
![]() missing period at the end of the sentence. missing period at the end of the sentence.
![]() missing period at end of sentence. missing period at end of sentence.
|
|
@ -19,19 +19,19 @@ const powerLimitFileLongWindow = "constraint_0_power_limit_uw"
|
|||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
// capNode uses pseudo files made available by the Linux kernel
|
||||
// in order to capNode CPU power. More information is available at:
|
||||
// https://www.kernel.org/doc/html/latest/power/powercap/powercap.html
|
||||
func capNode(base string, percentage int) error {
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
func capNode(base string, percentage int) ([]string, []string, error) {
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
|
||||
if percentage <= 0 || percentage > 100 {
|
||||
return fmt.Errorf("cap percentage must be between (0, 100]: %d", percentage)
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
return nil, nil, fmt.Errorf("cap percentage must be between 0 (non-inclusive) and 100 (inclusive): %d", percentage)
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
}
|
||||
|
||||
files, err := ioutil.ReadDir(base)
|
||||
if err != nil {
|
||||
return err
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
return nil, nil, err
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
}
|
||||
|
||||
var capped, failed []string
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
for _, file := range files {
|
||||
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
fields := strings.Split(file.Name(), ":")
|
||||
|
||||
// Fields should be in the form intel-rapl:X where X is the power zone
|
||||
|
@ -43,22 +43,28 @@ func capNode(base string, percentage int) error {
|
|||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
if fields[0] == raplPrefixCPU {
|
||||
maxPower, err := maxPower(filepath.Join(base, file.Name(), maxPowerFileLongWindow))
|
||||
if err != nil {
|
||||
failed = append(failed, file.Name())
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
fmt.Println("unable to retreive max power for zone ", err)
|
||||
![]() any reason for just printing the error and not returning it? any reason for just printing the error and not returning it?
Basically, the question is whether we need to continue to attempt to powercap if an error occurs anywhere in the process.
![]() Agreed, I don't know what the right path to take is here. If the file write fails, we could be left in an inconsistent state. The only options here are to bail and return an error right away, or to continue trying to cap the node and then returning an array of zones where were unable to cap the node in. Agreed, I don't know what the right path to take is here. If the file write fails, we could be left in an inconsistent state. The only options here are to bail and return an error right away, or to continue trying to cap the node and then returning an array of zones where were unable to cap the node in.
![]() Any chance we can roll back the power limits set to the previous values if and when any of the file writes fail? Any chance we can roll back the power limits set to the previous values if and when any of the file writes fail?
![]() If the write fails, we're sort of left in limbo. If the write to modify it failed, then most likely the write to restore the value will fail too. We can try reading it and seeing if that's the same value as before. If the write fails, we're sort of left in limbo. If the write to modify it failed, then most likely the write to restore the value will fail too. We can try reading it and seeing if that's the same value as before.
|
||||
continue
|
||||
}
|
||||
|
||||
// We use floats to mitigate the possibility of an integer overflows.
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
// We use floats to mitigate the possibility of an integer overflow.
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
powercap := uint64(math.Ceil(float64(maxPower) * (float64(percentage) / 100)))
|
||||
|
||||
err = capZone(filepath.Join(base, file.Name(), powerLimitFileLongWindow), powercap)
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
if err != nil {
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
if err := capZone(filepath.Join(base, file.Name(), powerLimitFileLongWindow), powercap); err != nil {
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
failed = append(failed, file.Name())
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
fmt.Println("unable to write powercap value: ", err)
|
||||
![]() same here regarding whether the error to continue if error occurs or should we just return it. same here regarding whether the error to continue if error occurs or should we just return it.
|
||||
continue
|
||||
}
|
||||
capped = append(capped, file.Name())
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
if len(failed) > 0 {
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
return capped, failed, fmt.Errorf("some zones were not able to be powercapped")
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
}
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
return capped, nil, nil
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
}
|
||||
|
||||
// maxPower returns the value in float of the maximum watts a power zone can use.
|
||||
|
@ -88,3 +94,17 @@ func capZone(limitFile string, value uint64) error {
|
|||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
func currentCap(limit string) (uint64, error) {
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
powercap, err := ioutil.ReadFile(limit)
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
if err != nil {
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
return 0, err
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
}
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
powercapuW, err := strconv.ParseUint(strings.TrimSpace(string(powercap)), 10, 64)
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
if err != nil {
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
return 0, err
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
}
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
return powercapuW, nil
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
}
|
||||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
||||
|
|
|||
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
![]() constraint_1 is the shorter window. constraint_1 is the shorter window.
![]() maybe just say cap percentage must be in the range (0, 100]. maybe just say **cap percentage must be in the range (0, 100]**.
![]() constraint_0 is the longer window. constraint_0 is the longer window.
Going by [this](https://github.com/spdfg/elektron/blob/master/scripts/RAPL_PKG_Throttle.py#L48) we are intending to use the longer window for running average calculations.
So, change the variable name to `maxPowerFileLongWindow`?
![]() ditto. ditto.
![]() overflow overflow~s~
![]() fits on a single line. fits on a single line.
![]() Can you expand on this comment? Can you expand on this comment?
![]() Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is. Actually, your way of representing the ranges is more explicit and clear. One is not well-versed with range expressions would still be able to understand your explanation. So, ignore my previous statement and leave it as is.
![]() Either change overflows to overflow, or get rid of the "an". Either change **overflows** to **overflow**, or get rid of the "an".
![]() Good catch, fixed. Good catch, fixed.
![]() Fixed this, definitely a mistake on my part. Thanks for catching it! Fixed this, definitely a mistake on my part. Thanks for catching it!
![]() I'll revert it I'll revert it
|
|
@ -7,7 +7,6 @@ import (
|
|||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -48,18 +47,25 @@ func TestMain(m *testing.M) {
|
|||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
// TODO(rdelvalle): Add tests where capping fails
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
func TestCapNode(t *testing.T) {
|
||||
err := capNode(raplDir, 95)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
capped, failed, err := capNode(raplDir, 95)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, capped, 1)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
assert.Nil(t, failed)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
|
||||
t.Run("bad-percentage", func(t *testing.T) {
|
||||
err := capNode(raplDir, 1000)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
capped, failed, err := capNode(raplDir, 1000)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, capped)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
assert.Nil(t, failed)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
})
|
||||
|
||||
t.Run("zero-percent", func(t *testing.T) {
|
||||
err := capNode(raplDir, 0)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
capped, failed, err := capNode(raplDir, 0)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, capped)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
assert.Nil(t, failed)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -84,10 +90,7 @@ func TestCapZone(t *testing.T) {
|
|||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
err := capZone(limitFile, powercap)
|
||||
assert.NoError(t, err)
|
||||
|
||||
newCapBytes, err := ioutil.ReadFile(limitFile)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
assert.NoError(t, err)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
newCap, err := strconv.ParseUint(strings.TrimSpace(string(newCapBytes)), 10, 64)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
newCap, err := currentCap(limitFile)
|
||||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, powercap, newCap)
|
||||
|
||||
|
|
|||
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
![]() I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.
![]() Good point, fixed. Good point, fixed.
|
capable of changing