hugo: github.com/gohugoio/hugo/metrics Index | Files

package metrics

import "github.com/gohugoio/hugo/metrics"

Package metrics provides simple metrics tracking features.

Index

Package Files

metrics.go

type Provider Uses

type Provider interface {
    // MeasureSince adds a measurement for key to the metric store.
    // Used with defer and time.Now().
    MeasureSince(key string, start time.Time)

    // WriteMetrics will write a summary of the metrics to w.
    WriteMetrics(w io.Writer)

    // TrackValue tracks the value for diff calculations etc.
    TrackValue(key string, value interface{})

    // Reset clears the metric store.
    Reset()
}

The Provider interface defines an interface for measuring metrics.

func NewProvider Uses

func NewProvider(calculateHints bool) Provider

NewProvider returns a new instance of a metric store.

type Store Uses

type Store struct {
    // contains filtered or unexported fields
}

Store provides storage for a set of metrics.

func (*Store) MeasureSince Uses

func (s *Store) MeasureSince(key string, start time.Time)

MeasureSince adds a measurement for key to the metric store.

func (*Store) Reset Uses

func (s *Store) Reset()

Reset clears the metrics store.

func (*Store) TrackValue Uses

func (s *Store) TrackValue(key string, value interface{})

TrackValue tracks the value for diff calculations etc.

func (*Store) WriteMetrics Uses

func (s *Store) WriteMetrics(w io.Writer)

WriteMetrics writes a summary of the metrics to w.

Package metrics imports 12 packages (graph) and is imported by 73 packages. Updated 2020-03-22. Refresh now. Tools for package owners.