mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
metrics: Add simple template metrics feature
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
cb8eb47260
commit
b4a14c25fe
7
deps/deps.go
vendored
7
deps/deps.go
vendored
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
"github.com/gohugoio/hugo/metrics"
|
||||
"github.com/gohugoio/hugo/output"
|
||||
"github.com/gohugoio/hugo/tpl"
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
@@ -47,6 +48,8 @@ type Deps struct {
|
||||
WithTemplate func(templ tpl.TemplateHandler) error `json:"-"`
|
||||
|
||||
translationProvider ResourceProvider
|
||||
|
||||
Metrics metrics.Provider
|
||||
}
|
||||
|
||||
// ResourceProvider is used to create and refresh, and clone resources needed.
|
||||
@@ -131,6 +134,10 @@ func New(cfg DepsCfg) (*Deps, error) {
|
||||
Language: cfg.Language,
|
||||
}
|
||||
|
||||
if cfg.Cfg.GetBool("templateMetrics") {
|
||||
d.Metrics = metrics.NewProvider()
|
||||
}
|
||||
|
||||
return d, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user