github.com/wuhuizuo/gomplate@v3.5.0+incompatible/metrics.go (about)

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