mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +00:00
grid2: add metrics registration guard
This commit is contained in:
parent
4a68f0e75c
commit
d43acaa17c
|
@ -66,10 +66,17 @@ func initMetrics(extendedLabels []string) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var metricsRegistered = false
|
||||||
|
|
||||||
func registerMetrics() {
|
func registerMetrics() {
|
||||||
|
if metricsRegistered {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
prometheus.MustRegister(
|
prometheus.MustRegister(
|
||||||
metricsGridNumOfOrders,
|
metricsGridNumOfOrders,
|
||||||
metricsGridProfit,
|
metricsGridProfit,
|
||||||
metricsGridOrderPrices,
|
metricsGridOrderPrices,
|
||||||
)
|
)
|
||||||
|
metricsRegistered = true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user