github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/daemon/images/locals.go (about)

     1  package images // import "github.com/docker/docker/daemon/images"
     2  
     3  import (
     4  	"fmt"
     5  
     6  	metrics "github.com/docker/go-metrics"
     7  )
     8  
     9  type invalidFilter struct {
    10  	filter string
    11  	value  interface{}
    12  }
    13  
    14  func (e invalidFilter) Error() string {
    15  	msg := "invalid filter '" + e.filter
    16  	if e.value != nil {
    17  		msg += fmt.Sprintf("=%s", e.value)
    18  	}
    19  	return msg + "'"
    20  }
    21  
    22  func (e invalidFilter) InvalidParameter() {}
    23  
    24  var imageActions metrics.LabeledTimer
    25  
    26  func init() {
    27  	ns := metrics.NewNamespace("engine", "daemon", nil)
    28  	imageActions = ns.NewLabeledTimer("image_actions", "The number of seconds it takes to process each image action", "action")
    29  	// TODO: is it OK to register a namespace with the same name? Or does this
    30  	// need to be exported from somewhere?
    31  	metrics.Register(ns)
    32  }