Rapl node capping daemon #21
|
@ -4,6 +4,7 @@ import (
|
|||
![]() 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
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"os"
|
||||
![]() 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
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -65,12 +66,12 @@ 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
|
||||
func maxPower(maxFile string) (uint64, error) {
|
||||
maxPower, err := ioutil.ReadFile(maxFile)
|
||||
if err != nil {
|
||||
return 0.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
|
||||
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
|
||||
}
|
||||
|
||||
maxPoweruW, err := strconv.ParseUint(strings.TrimSpace(string(maxPower)), 10, 64)
|
||||
if err != nil {
|
||||
return 0.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
|
||||
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
|
||||
}
|
||||
|
||||
return maxPoweruW, nil
|
||||
|
@ -78,6 +79,10 @@ func maxPower(maxFile 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
![]() 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
|
||||
|
||||
// capZone caps a power zone to a specific amount of watts specified by value
|
||||
func capZone(limitFile string, value uint64) error {
|
||||
if _, err := os.Stat(limitFile); os.IsNotExist(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 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
|
||||
err := ioutil.WriteFile(limitFile, []byte(strconv.FormatUint(value, 10)), 0644)
|
||||
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
![]() 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
|
|
@ -52,6 +52,16 @@ 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.
|
||||
func TestCapNode(t *testing.T) {
|
||||
err := capNode(raplDir, 95)
|
||||
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.
|
||||
t.Run("badPercentage", func(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.
|
||||
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)
|
||||
![]() 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.
|
||||
|
||||
![]() 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("zeroPercent", func(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.
|
||||
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)
|
||||
![]() 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.
|
||||
}
|
||||
|
||||
func TestMaxPower(t *testing.T) {
|
||||
|
@ -60,6 +70,11 @@ func TestMaxPower(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.
|
||||
maxWatts, err := maxPower(maxFile)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, maxWattage, maxWatts)
|
||||
|
||||
![]() 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("nameDoesNotExist", func(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.
|
||||
_, err := maxPower("madeupname")
|
||||
![]() 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)
|
||||
![]() 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.
|
||||
}
|
||||
|
||||
func TestCapZone(t *testing.T) {
|
||||
|
@ -76,4 +91,9 @@ 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.
|
||||
newCap, err := strconv.ParseUint(strings.TrimSpace(string(newCapBytes)), 10, 64)
|
||||
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.
|
||||
t.Run("nameDoesNotExist", func(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.
|
||||
err := capZone("madeupname", powercap)
|
||||
![]() 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)
|
||||
![]() 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.
|
||||
}
|
||||
|
|
|||
![]() 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.
|
constraint_1 is the shorter window.
maybe just say cap percentage must be in the range (0, 100].
constraint_0 is the longer window.
Going by this we are intending to use the longer window for running average calculations.
So, change the variable name to
maxPowerFileLongWindow
?ditto.
overflow
sfits on a single line.