diff options
author | Cameron Moore <moorereason@gmail.com> | 2021-01-08 10:26:35 -0600 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2021-01-08 20:01:11 +0100 |
commit | 0004a733c85cee991a8a170e93cd69c326cc8f2f (patch) | |
tree | 3556fc9533bfd1ce705da0e0e4fd04aac8288e34 /tpl/partials | |
parent | 8a26ab0bc5dd9fa34e1362681fc08b0e522cd4ea (diff) |
tpl: Fix metrics hint tracking
When tracking for cache hints, track the same template name as the call
to MeasureSince in Execute. When referencing a partial "foo", the value
of `n` does not match `templ.Name()` (`partials/foo` versus
`partials/foo.html`). This was causing hints to go untracked since
there was no existing metric to append the hint to.
Fixes #8125
Diffstat (limited to 'tpl/partials')
-rw-r--r-- | tpl/partials/partials.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tpl/partials/partials.go b/tpl/partials/partials.go index 016e0423c..e8a8adc36 100644 --- a/tpl/partials/partials.go +++ b/tpl/partials/partials.go @@ -155,7 +155,7 @@ func (ns *Namespace) Include(name string, contextList ...interface{}) (interface } if ns.deps.Metrics != nil { - ns.deps.Metrics.TrackValue(n, result) + ns.deps.Metrics.TrackValue(templ.Name(), result) } return result, nil |