Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-06-25 12:44:27 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-06-25 13:19:21 +0300
commit48dbb593f7cc0dceb55d232ac198e82f3df1c964 (patch)
treec2e95f63e4b4d873447e69513b92a32c3c0a2465 /commands/commands.go
parentf0266e2ef3487bc57dd05402002fc816e3b40195 (diff)
commands: Add an option to print memory usage at intervals
Use it with `hugo --print-mem
Diffstat (limited to 'commands/commands.go')
-rw-r--r--commands/commands.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/commands.go b/commands/commands.go
index 66fd9caa4..09e0c8455 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -212,6 +212,7 @@ type hugoBuilderCommon struct {
memprofile string
mutexprofile string
traceprofile string
+ printm bool
// TODO(bep) var vs string
logging bool
@@ -299,6 +300,7 @@ func (cc *hugoBuilderCommon) handleFlags(cmd *cobra.Command) {
cmd.Flags().BoolP("path-warnings", "", false, "print warnings on duplicate target paths etc.")
cmd.Flags().StringVarP(&cc.cpuprofile, "profile-cpu", "", "", "write cpu profile to `file`")
cmd.Flags().StringVarP(&cc.memprofile, "profile-mem", "", "", "write memory profile to `file`")
+ cmd.Flags().BoolVarP(&cc.printm, "print-mem", "", false, "print memory usage to screen at intervals")
cmd.Flags().StringVarP(&cc.mutexprofile, "profile-mutex", "", "", "write Mutex profile to `file`")
cmd.Flags().StringVarP(&cc.traceprofile, "trace", "", "", "write trace to `file` (not useful in general)")