forked from hairyhenderson/gomplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics.go
24 lines (20 loc) · 883 Bytes
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package gomplate
import "time"
// Metrics tracks interesting basic metrics around gomplate executions. Warning: experimental!
// This may change in breaking ways without warning. This is not subject to any semantic versioning guarantees!
var Metrics *MetricsType
// MetricsType - Warning: experimental! This may change in breaking ways without warning.
// This is not subject to any semantic versioning guarantees!
type MetricsType struct {
TemplatesGathered int
TemplatesProcessed int
Errors int
GatherDuration time.Duration // time it took to gather templates
TotalRenderDuration time.Duration // time it took to render all templates
RenderDuration map[string]time.Duration // times for rendering each template
}
func newMetrics() *MetricsType {
return &MetricsType{
RenderDuration: make(map[string]time.Duration),
}
}