Skip to content

Commit

Permalink
Add RDMA collector
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaodong Ye <[email protected]>
  • Loading branch information
yeahdongcn committed Nov 8, 2024
1 parent 0fddfd1 commit 1211fae
Show file tree
Hide file tree
Showing 4 changed files with 445 additions and 0 deletions.
8 changes: 8 additions & 0 deletions collector/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ func readUintFromFile(path string) (uint64, error) {
return value, nil
}

func readStringFromFile(path string) string {
data, err := os.ReadFile(path)
if err != nil {
return ""
}
return strings.TrimSpace(string(data))
}

var metricNameRegex = regexp.MustCompile(`_*[^0-9A-Za-z_]+_*`)

// SanitizeMetricName sanitize the given metric name by replacing invalid characters by underscores.
Expand Down
Loading

0 comments on commit 1211fae

Please sign in to comment.