Skip to content

Commit

Permalink
feat(attributes): add proc status and mem info for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszKepczynskiSauce committed Nov 28, 2024
1 parent d47eedd commit f2935ce
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions procmeminfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,12 @@ var (
)

func readMemProcInfo() {
done := make(chan bool, 2)
for _, path := range paths {
go readFile(path, done)
}

// wait for readFile to finish
for i := 0; i < 2; i++ {
<-done
readFile(path)
}
}

func readFile(path string, done chan bool) {
func readFile(path string) {
file, err := os.Open(path)
if err != nil {
log.Fatal(err)
Expand Down Expand Up @@ -94,7 +88,6 @@ func readFile(path string, done chan bool) {
}
}
}
done <- true
}

func mapValues(key string, value string, mapper map[string]string) {
Expand Down

0 comments on commit f2935ce

Please sign in to comment.