Alerting: Add duration to saving alert states done (#70844)

This commit is contained in:
George Robinson 2023-06-28 15:19:21 +01:00 committed by GitHub
parent 5732fc7b2a
commit 594c851d4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -385,9 +385,10 @@ func (st *Manager) saveAlertStates(ctx context.Context, logger log.Logger, state
return nil
}
start := time.Now()
logger.Debug("Saving alert states", "count", len(states), "max_state_save_concurrency", st.maxStateSaveConcurrency)
_ = concurrency.ForEachJob(ctx, len(states), st.maxStateSaveConcurrency, saveState)
logger.Debug("Saving alert states done", "count", len(states), "max_state_save_concurrency", st.maxStateSaveConcurrency)
logger.Debug("Saving alert states done", "count", len(states), "max_state_save_concurrency", st.maxStateSaveConcurrency, "duration", time.Since(start))
}
func (st *Manager) deleteAlertStates(ctx context.Context, logger log.Logger, states []StateTransition) {