File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ func init() {
27
27
// Metrics have to be registered to be exposed
28
28
prometheus .MustRegister (NewAccountsCollector ()) // from accounts.go
29
29
prometheus .MustRegister (NewCPUsCollector ()) // from cpus.go
30
- prometheus .MustRegister (NewGPUsCollector ()) // from gpus.go
31
30
prometheus .MustRegister (NewNodesCollector ()) // from nodes.go
32
31
prometheus .MustRegister (NewNodeCollector ()) // from node.go
33
32
prometheus .MustRegister (NewPartitionsCollector ()) // from partitions.go
@@ -42,8 +41,19 @@ var listenAddress = flag.String(
42
41
":8080" ,
43
42
"The address to listen on for HTTP requests." )
44
43
44
+ var gpuAcct = flag .Bool (
45
+ "gpus-acct" ,
46
+ false ,
47
+ "Enable GPUs accounting" )
48
+
45
49
func main () {
46
50
flag .Parse ()
51
+
52
+ // Turn on GPUs accounting only if the corresponding command line option is set to true.
53
+ if * gpuAcct {
54
+ prometheus .MustRegister (NewGPUsCollector ()) // from gpus.go
55
+ }
56
+
47
57
// The Handler function provides a default handler to expose metrics
48
58
// via an HTTP server. "/metrics" is the usual endpoint for that.
49
59
log .Infof ("Starting Server: %s" , * listenAddress )
You can’t perform that action at this time.
0 commit comments