Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verbose Go Mod Status #6519

Closed
HenrySkup opened this issue Nov 21, 2019 · 8 comments · Fixed by #6520
Closed

Verbose Go Mod Status #6519

HenrySkup opened this issue Nov 21, 2019 · 8 comments · Fixed by #6520
Assignees
Milestone

Comments

@HenrySkup
Copy link

Could we get a verbose readout while Go Mods / Hugo Mods are fetched? This can take a while, and having some sort of visibility of what's happening would make the UX/UI better.

@bep bep added Enhancement and removed Proposal labels Nov 21, 2019
@bep bep modified the milestones: v0.61, v0.60 Nov 21, 2019
@bep bep self-assigned this Nov 21, 2019
bep added a commit to bep/hugo that referenced this issue Nov 21, 2019
@HenrySkup
Copy link
Author

🙏

@bep
Copy link
Member

bep commented Nov 21, 2019

In #6520 I have added some timer output if collecting modules takes "some time". While testing it, I do see that Go prints when it downloading modules. Are you not currently seeing the "go: finding ..." statements?

And yes, I do find it curious that the "Total in ..." is less than "Collected modules ...", but that's because the module collection happens in the init phase and not during the build. I will try to fix that so it looks more "honest". But the below also shows that once cached, the module collection takes no time.

▶ hugo mod clean && hugo --ignoreVendor
go: finding github.com/gohugoio/gohugoioTheme v0.0.0-20191021162625-2e7250ca437d
Collected modules in 3683 ms

                   | EN  | ZH
+------------------+-----+-----+
  Pages            | 471 |  21
  Paginator pages  |   2 |   1
  Non-page files   |  55 |   0
  Static files     | 145 | 145
  Processed images |  99 |   0
  Aliases          |  16 |   4
  Sitemaps         |   2 |   1
  Cleaned          |   0 |   0

Total in 2687 ms

go/gohugoio/hugoDocs  security-model ✔                                                                           28m
▶ hugo

                   | EN  | ZH
+------------------+-----+-----+
  Pages            | 471 |  21
  Paginator pages  |   2 |   1
  Non-page files   |  55 |   0
  Static files     | 145 | 145
  Processed images |  99 |   0
  Aliases          |  16 |   4
  Sitemaps         |   2 |   1
  Cleaned          |   0 |   0

Total in 2267 ms

bep added a commit to bep/hugo that referenced this issue Nov 21, 2019
bep added a commit to bep/hugo that referenced this issue Nov 21, 2019
@bep
Copy link
Member

bep commented Nov 21, 2019

The same output from a more modular site:

sites/hugomod/my-modular-site  master ✗                                                                       98d ⚑
▶ hugo
go: finding github.com/bep/hugo-fresh v1.0.1
go: finding github.com/bep/hugo-github/repo v0.0.0-20191002153307-6ef93234ce20
go: finding github.com/bep/hugotestmods/myassets v1.0.4
go: finding github.com/bep/hugotestmods/mymounts v1.2.0
go: finding github.com/bep/hugotestmods/mypartials v1.0.7
go: finding github.com/bep/hugotestmods/myv2 v1.0.0
go: finding github.com/spf13/hyde v1.0.1
hugo: collected modules in 8350 ms

                   | EN
+------------------+----+
  Pages            |  5
  Paginator pages  |  0
  Non-page files   |  0
  Static files     | 46
  Processed images |  3
  Aliases          |  0
  Sitemaps         |  1
  Cleaned          |  0

Total in 8429 ms

sites/hugomod/my-modular-site  master ✗                                                                       98d ⚑
▶ hugo

                   | EN
+------------------+----+
  Pages            |  5
  Paginator pages  |  0
  Non-page files   |  0
  Static files     | 46
  Processed images |  4
  Aliases          |  0
  Sitemaps         |  1
  Cleaned          |  0

Total in 192 ms

Second build is with "warm cache".

bep added a commit to bep/hugo that referenced this issue Nov 21, 2019
Also include the time to collect modules etc. in the "Total in ..." time reported for the `hugo` command.

Fixes gohugoio#6519
@bep
Copy link
Member

bep commented Nov 21, 2019

I'm merging the above PR. If it still isn't good enough, please shout.

@bep bep closed this as completed in #6520 Nov 21, 2019
bep added a commit that referenced this issue Nov 21, 2019
Also include the time to collect modules etc. in the "Total in ..." time reported for the `hugo` command.

Fixes #6519
@HenrySkup
Copy link
Author

Looks good. I've found that there is a long delay between running the build and when go: finding... prints to screen (and when it does, it does so for all mods at one time).

Maybe having a finding => found => pulling => done sequence would help with debug?

(I also hope that I'm doing my cacheing correctly.)

@bep
Copy link
Member

bep commented Nov 22, 2019

Maybe having a finding => found => pulling => done sequence would help with debug?

I kind of dislike to fill my screen with lots of lines for every build if I don't have to and since this is delegated to Go and there is no more verbose output to have there (I checked), the best thing we could add is a "Start collecting ..." which we can add, but just as a INFO statement.

When I test this with a site with 8-10 modules, I get like 9 seconds the first time (clean cache), then 20-milliseconds or so for the subsequent builds. If you see something else, you should check your cache setup (and do not run with --ignoreCache).

Cache is good.

@bep
Copy link
Member

bep commented Nov 27, 2019

I will take one more stab at this.

@bep bep reopened this Nov 27, 2019
@bep bep closed this as completed in 14a1de1 Nov 27, 2019
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants