mirror of https://github.com/databricks/cli.git
Log time it takes for profile to load (#1186)
## Changes Aids debugging why `auth profiles` may take longer than expected. ## Tests Confirmed manually that timing information shows up in the log output.
This commit is contained in:
parent
8e58e04e8f
commit
b1b5ad8acd
|
@ -6,9 +6,11 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/databricks/cli/libs/cmdio"
|
"github.com/databricks/cli/libs/cmdio"
|
||||||
"github.com/databricks/cli/libs/databrickscfg"
|
"github.com/databricks/cli/libs/databrickscfg"
|
||||||
|
"github.com/databricks/cli/libs/log"
|
||||||
"github.com/databricks/databricks-sdk-go"
|
"github.com/databricks/databricks-sdk-go"
|
||||||
"github.com/databricks/databricks-sdk-go/config"
|
"github.com/databricks/databricks-sdk-go/config"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
@ -117,8 +119,10 @@ func newProfilesCommand() *cobra.Command {
|
||||||
}
|
}
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
// load more information about profile
|
ctx := cmd.Context()
|
||||||
profile.Load(cmd.Context(), skipValidate)
|
t := time.Now()
|
||||||
|
profile.Load(ctx, skipValidate)
|
||||||
|
log.Debugf(ctx, "Profile %q took %s to load", profile.Name, time.Since(t))
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
profiles = append(profiles, profile)
|
profiles = append(profiles, profile)
|
||||||
|
|
Loading…
Reference in New Issue