forked from hairyhenderson/gomplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics.go
28 lines (23 loc) · 852 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
25
26
27
28
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 {
// times for rendering each template
RenderDuration map[string]time.Duration
// time it took to gather templates
GatherDuration time.Duration
// time it took to render all templates
TotalRenderDuration time.Duration
TemplatesGathered int
TemplatesProcessed int
Errors int
}
func newMetrics() *MetricsType {
return &MetricsType{
RenderDuration: make(map[string]time.Duration),
}
}