Rapl node capping daemon #21

Merged
ridv merged 18 commits from raplDaemon into master 2020-01-19 19:52:32 +00:00
Showing only changes of commit 78d1a11583 - Show all commits

View file

@ -1,10 +1,11 @@
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
package main
import (
"fmt"
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
"io/ioutil"
"math"
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
"os"
"strconv"
"strings"
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
"testing"
"github.com/stretchr/testify/assert"
@ -29,7 +30,6 @@ func TestMaxPower(t *testing.T) {
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
defer os.Remove(tmpfile.Name())
fmt.Println(tmpfile.Name())
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
_, err = tmpfile.Write([]byte(strconv.FormatUint(maxWattage, 10)))
assert.NoError(t, err)
@ -40,3 +40,29 @@ func TestMaxPower(t *testing.T) {
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
err = tmpfile.Close()
assert.NoError(t, err)
}
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
func TestCapZone(t *testing.T) {
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
const maxPower float64 = 1500000
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
const percentage float64 = .50
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
tmpfile, err := ioutil.TempFile("", powerLimitFileShortWindow)
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
assert.NoError(t, err)
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
defer os.Remove(tmpfile.Name())
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
powercap := uint64(math.Ceil(maxPower * percentage))
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
err = capZone(tmpfile.Name(), powercap)
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
assert.NoError(t, err)
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
newCapBytes, err := ioutil.ReadFile(tmpfile.Name())
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
assert.NoError(t, err)
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
newCap, err := strconv.ParseUint(strings.TrimSpace(string(newCapBytes)), 10, 64)
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
assert.NoError(t, err)
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
assert.Equal(t, powercap, newCap)
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
err = tmpfile.Close()
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
assert.NoError(t, err)
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
}
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.

pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.
pradykaushik commented 2020-01-13 19:45:13 +00:00 (Migrated from github.com)

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default.
Although, I do not mind the camelcasing.

I think it's safe to use spaces ("bad percentage") as the words are hyphenated by default. Although, I do not mind the camelcasing.
ridv commented 2020-01-18 01:22:53 +00:00 (Migrated from github.com)

Good point, fixed.

Good point, fixed.