-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix]: try to reduce escapes to heap #1886
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,7 +234,7 @@ func getBoolConfig(configKey string, defaultBool bool) bool { | |
} | ||
|
||
func getIntConfig(configKey string, defaultInt int) int { | ||
defaultValue := fmt.Sprintf("%d", defaultInt) | ||
defaultValue := strconv.Itoa(defaultInt) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix |
||
value, err := strconv.Atoi(getConfig(configKey, defaultValue)) | ||
if err == nil { | ||
return value | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ const ( | |
|
||
var ( | ||
podURL string | ||
client http.Client | ||
) | ||
|
||
func init() { | ||
|
@@ -50,6 +51,8 @@ func init() { | |
port = "10250" | ||
} | ||
podURL = "https://" + nodeName + ":" + port + "/pods" | ||
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} | ||
client = http.Client{} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
func httpGet(url string) (*http.Response, error) { | ||
|
@@ -65,8 +68,6 @@ func httpGet(url string) (*http.Response, error) { | |
return nil, err | ||
} | ||
req.Header.Add("Authorization", bearer) | ||
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} | ||
client := &http.Client{} | ||
resp, err := client.Do(req) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to get response from %q: %v", url, err) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,18 +57,16 @@ var ( | |
LogisticTrainer, | ||
ExponentialTrainer, | ||
} | ||
ModelOutputTypeConverter = []string{"AbsPower", "DynPower"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
fixed |
||
ModelTypeConverter = []string{"Ratio", "Regressor", "EstimatorSidecar"} | ||
) | ||
|
||
func getModelOutputTypeConverter() []string { | ||
return []string{ | ||
"AbsPower", "DynPower", | ||
} | ||
return ModelOutputTypeConverter | ||
} | ||
|
||
func getModelTypeConverter() []string { | ||
return []string{ | ||
"Ratio", "Regressor", "EstimatorSidecar", | ||
} | ||
return ModelTypeConverter | ||
} | ||
|
||
func (s ModelOutputType) String() string { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
Error: pkg/collector/stats/types/types.go:17:10: &UInt64Stat{} escapes to heap
ref https://github.com/sustainable-computing-io/kepler/actions/runs/12177539929/job/33966954289
and
https://github.com/sustainable-computing-io/kepler/actions/runs/12197388859/job/34026929446?pr=1886