diff --git a/pkg/storage/stores/shipper/downloads/table_manager.go b/pkg/storage/stores/shipper/downloads/table_manager.go index b552cc272351a..04d61d2784c28 100644 --- a/pkg/storage/stores/shipper/downloads/table_manager.go +++ b/pkg/storage/stores/shipper/downloads/table_manager.go @@ -7,6 +7,7 @@ import ( "path/filepath" "regexp" "strconv" + "strings" "sync" "time" @@ -241,6 +242,11 @@ func (tm *TableManager) cleanupCache() error { // ensureQueryReadiness compares tables required for being query ready with the tables we already have and downloads the missing ones. func (tm *TableManager) ensureQueryReadiness(ctx context.Context) error { + start := time.Now() + defer func() { + level.Info(util_log.Logger).Log("msg", "query readiness setup completed", "duration", time.Since(start)) + }() + activeTableNumber := getActiveTableNumber() // find the largest query readiness number @@ -309,9 +315,12 @@ func (tm *TableManager) ensureQueryReadiness(ctx context.Context) error { return err } + perTableStart := time.Now() if err := table.EnsureQueryReadiness(ctx, usersToBeQueryReadyFor); err != nil { return err } + joinedUsers := strings.Join(usersToBeQueryReadyFor, ",") + level.Info(util_log.Logger).Log("msg", "index pre-download for query readiness completed", "users", joinedUsers, "duration", time.Since(perTableStart), "table", tableName) } return nil