Skip to content

Commit

Permalink
spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
kmulvey committed Aug 23, 2024
1 parent ea64d1b commit 2f28f6c
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
@@ -71,7 +71,6 @@ func main() {

ticker := time.NewTicker(time.Duration(updateInterval * int(time.Millisecond)))
for range ticker.C {

err = collectStats(statMap, cards) // statMap is defined in stats.go
if err != nil {
log.Fatal(err)
@@ -98,7 +97,6 @@ func findRadeonDevices() ([]path.Entry, error) {

var results []path.Entry
for _, file := range files {

b, err := os.ReadFile(file.AbsolutePath)
if err != nil {
return nil, err
@@ -121,16 +119,13 @@ func findRadeonDevices() ([]path.Entry, error) {
func collectStats(statMap map[string]*prometheus.GaugeVec, cards []path.Entry) error {

for _, card := range cards {

var cardId = filepath.Base(card.AbsolutePath)

for statName, promStat := range statMap {

var value, err = parseFileAsFloat(filepath.Join(card.AbsolutePath, statName))
if err != nil {
return err
}

promStat.WithLabelValues(cardId).Set(value)
}
}

0 comments on commit 2f28f6c

Please sign in to comment.