diff options
author | Sean E. Russell <ser@ser1.net> | 2020-05-12 18:42:45 -0500 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2020-05-12 18:42:45 -0500 |
commit | 310a6d084d5ff56ebb26cd667f46f578b39c737a (patch) | |
tree | a1b98a9a3736f9c8aa9057623f62b109294dc4f3 /widgets/metrics.go | |
parent | b0e1e9a20ad2c198b65df420aef5821c7be7208c (diff) |
Replaces the Prometheus client with VictoriaMetrics/metrics
Diffstat (limited to 'widgets/metrics.go')
-rw-r--r-- | widgets/metrics.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/widgets/metrics.go b/widgets/metrics.go new file mode 100644 index 0000000..683b196 --- /dev/null +++ b/widgets/metrics.go @@ -0,0 +1,19 @@ +package widgets + +import ( + "fmt" + "strings" +) + +// makeName creates a prometheus metric name in the gotop space +// This function doesn't have to be very efficient because it's only +// called at init time, and only a few dozen times... and it isn't +// (very efficient). +func makeName(parts ...interface{}) string { + args := make([]string, len(parts)+1) + args[0] = "gotop" + for i, v := range parts { + args[i+1] = fmt.Sprintf("%v", v) + } + return strings.Join(args, "_") +} |