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 (NewPartitionsCollector ()) // from partitions.go
33
32
prometheus .MustRegister (NewQueueCollector ()) // from queue.go
@@ -41,8 +40,19 @@ var listenAddress = flag.String(
41
40
":8080" ,
42
41
"The address to listen on for HTTP requests." )
43
42
43
+ var gpuAcct = flag .Bool (
44
+ "gpus-acct" ,
45
+ false ,
46
+ "Enable GPUs accounting" )
47
+
44
48
func main () {
45
49
flag .Parse ()
50
+
51
+ // Turn on GPUs accounting only if the corresponding command line option is set to true.
52
+ if * gpuAcct {
53
+ prometheus .MustRegister (NewGPUsCollector ()) // from gpus.go
54
+ }
55
+
46
56
// The Handler function provides a default handler to expose metrics
47
57
// via an HTTP server. "/metrics" is the usual endpoint for that.
48
58
log .Infof ("Starting Server: %s" , * listenAddress )
You can’t perform that action at this time.
0 commit comments