grid2: reset metricsGridOrderPrices

This commit is contained in:
c9s 2023-01-10 21:21:35 +08:00
parent 857b5d0f30
commit 75919a0bf1
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -881,6 +881,7 @@ func (s *Strategy) openGrid(ctx context.Context, session *bbgo.ExchangeSession)
func (s *Strategy) updateOpenOrderPricesMetrics(orders []types.Order) {
orders = sortOrdersByPriceAscending(orders)
num := len(orders)
metricsGridOrderPrices.Reset()
for idx, order := range orders {
labels := s.newPrometheusLabels()
labels["ith"] = strconv.Itoa(num - idx)