2018-02-07 20:52:47 +00:00
|
|
|
package images // import "github.com/docker/docker/daemon/images"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2019-08-05 14:37:47 +00:00
|
|
|
metrics "github.com/docker/go-metrics"
|
2018-02-07 20:52:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type invalidFilter struct {
|
|
|
|
filter string
|
|
|
|
value interface{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e invalidFilter) Error() string {
|
2022-03-02 17:56:06 +00:00
|
|
|
msg := "invalid filter '" + e.filter
|
2018-02-07 20:52:47 +00:00
|
|
|
if e.value != nil {
|
|
|
|
msg += fmt.Sprintf("=%s", e.value)
|
|
|
|
}
|
|
|
|
return msg + "'"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e invalidFilter) InvalidParameter() {}
|
|
|
|
|
|
|
|
var imageActions metrics.LabeledTimer
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
ns := metrics.NewNamespace("engine", "daemon", nil)
|
|
|
|
imageActions = ns.NewLabeledTimer("image_actions", "The number of seconds it takes to process each image action", "action")
|
|
|
|
// TODO: is it OK to register a namespace with the same name? Or does this
|
|
|
|
// need to be exported from somewhere?
|
|
|
|
metrics.Register(ns)
|
|
|
|
}
|