diff --git a/tui/bubbles/repo/bubble.go b/tui/bubbles/repo/bubble.go index b2562fe57..f75d7c52c 100644 --- a/tui/bubbles/repo/bubble.go +++ b/tui/bubbles/repo/bubble.go @@ -3,10 +3,12 @@ package repo import ( "bytes" "fmt" + "log" "soft-serve/git" "soft-serve/tui/style" "strconv" "text/template" + "time" "github.com/charmbracelet/bubbles/viewport" tea "github.com/charmbracelet/bubbletea" @@ -158,6 +160,7 @@ func (b Bubble) sshAddress() string { } func (b *Bubble) setupCmd() tea.Msg { + ct := time.Now() r, err := b.repoSource.GetRepo(b.name) if err == git.ErrMissingRepo { return nil @@ -179,6 +182,7 @@ func (b *Bubble) setupCmd() tea.Msg { } b.readmeViewport.Viewport.SetContent(md) b.GotoTop() + log.Printf("Repo bubble loaded in %s", time.Since(ct)) return nil } diff --git a/tui/commands.go b/tui/commands.go index 6deb2832f..7e305afe7 100644 --- a/tui/commands.go +++ b/tui/commands.go @@ -2,8 +2,10 @@ package tui import ( "fmt" + "log" "soft-serve/tui/bubbles/repo" "soft-serve/tui/bubbles/selection" + "time" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" @@ -18,6 +20,7 @@ func (e errMsg) Error() string { } func (b *Bubble) setupCmd() tea.Msg { + ct := time.Now() lipgloss.SetColorProfile(termenv.ANSI256) b.repos = b.repoSource.AllRepos() mes := make([]MenuEntry, 0) @@ -80,5 +83,6 @@ func (b *Bubble) setupCmd() tea.Msg { b.activeBox = 1 } b.state = loadedState + log.Printf("App bubble loaded in %s", time.Since(ct)) return nil } diff --git a/tui/session.go b/tui/session.go index 0110cc0e0..ee7211979 100644 --- a/tui/session.go +++ b/tui/session.go @@ -28,6 +28,7 @@ func SessionHandler(reposPath string, repoPoll time.Duration) func(ssh.Session) go func() { for { time.Sleep(repoPoll) + ct := time.Now() err := rs.LoadRepos() if err != nil { log.Printf("cannot load repos: %s", err) @@ -40,6 +41,7 @@ func SessionHandler(reposPath string, repoPoll time.Duration) func(ssh.Session) continue } } + log.Printf("Repos loaded in %s", time.Since(ct)) appCfg = cfg } }()