Would like a way to ask hugo to emit more runtime-relevant data alongside template metrics

as I’m working on a site, at various points I’ll capture the template metrics output from a clean start of hugo.

Some things that I think would be generally helpful to include, and is already available:

  • the date/time that this blob of template metrics were generated and posted to console.
  • the version of hugo being run
  • a dump of the config as hugo observed it when generating this particular run.
    • this would likely benefit from the inclusion of any/all command-line flags passed to hugo when it was started, as these aren’t likely to be represented in the config files

similar to the generation of hugo_stats.json (WHICH is a lifesaver. Thank you!)

I would think that having the ability to ask hugo to emit the version string it emits when starting to build the sites just before or after emitting the template metrics; alongside the current date/time wouldn’t be terribly hard, and would help by making it easier to assess build-to-build changes…

Hugo currently emits some things it deems relevant after the template metrics[1]

would it be unreasonable to emit the current date/time, and hugo version alongside this info?
or the commandline flags passed to hugo that aren’t captured in files in config…
I ask, as it seems to me that this information is equally relevant… and I’m not sure why it wouldn’t already be there… so there’s likely a good reason I don’t understand yet

:wink:


  1. Currently it emits: # of pages, # of files, # of images, # of aliases, some useful memory metrics, the hugo environment, how hugo is serving files, the serving URI, bound address ↩︎

You can output the time and Hugo version with {{ now }} and {{ hugo.Version }}.

Just a minor note: Your asking format ‘Would it be unreasonable…’ is not very friendly, as it assumes that either you, this function or the creator of this function is potentially unreasonable. ‘I would like/love this function to…’ is a nicer and more friendly way of putting this.

1 Like

Hai!

I was referring to the console output emitted alongside the template metrics. Sorry that wasn’t clear! :slight_smile:

Totally aware of these features inside an interpolated context…

Oh BRAVO! :slight_smile: thanks yo!

I sincerely didn’t consider that angle!

I was referring to my request; as in the intent was to assess the legitimacy of the feature request…

I hold this gaggle of peeps in the highest regard and was legitimately intending to approach the conversation with a flair of levity and deference.

the world is too chock full of people climbing over each other to get ahead…

I see communities like this as proof that not everyone is an utter selfish jerk…

I sincerely appreciate the perspective and feedback! thanks!

It’s a real challenge to point out politely that someone’s failing to be charming. You nailed
it :slight_smile:

hope yer having a great day!
:wolf:W