func (in instrumentedDockerInterface) InspectImage(image string) (*docker.Image, error) { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("inspect_image").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.InspectImage(image) }
func (in instrumentedDockerInterface) ListImages(opts docker.ListImagesOptions) ([]docker.APIImages, error) { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("list_images").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.ListImages(opts) }
func (in instrumentedDockerInterface) StopContainer(id string, timeout uint) error { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("stop_container").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.StopContainer(id, timeout) }
func (in instrumentedDockerInterface) RemoveContainer(opts docker.RemoveContainerOptions) error { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("remove_container").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.RemoveContainer(opts) }
func (in instrumentedDockerInterface) CreateExec(opts docker.CreateExecOptions) (*docker.Exec, error) { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("create_exec").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.CreateExec(opts) }
func (in instrumentedDockerInterface) StartExec(startExec string, opts docker.StartExecOptions) error { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("start_exec").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.StartExec(startExec, opts) }
func (in instrumentedDockerInterface) Info() (*docker.Env, error) { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("info").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.Info() }
func (in instrumentedDockerInterface) Logs(opts docker.LogsOptions) error { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("logs").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.Logs(opts) }
func (in instrumentedDockerInterface) RemoveImage(image string) error { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("remove_image").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.RemoveImage(image) }
func (in instrumentedDockerInterface) PullImage(opts docker.PullImageOptions, auth docker.AuthConfiguration) error { start := time.Now() defer func() { metrics.DockerOperationsLatency.WithLabelValues("pull_image").Observe(metrics.SinceInMicroseconds(start)) }() return in.client.PullImage(opts, auth) }
// Record the duration of the operation. func recordOperation(operation string, start time.Time) { metrics.DockerOperationsLatency.WithLabelValues(operation).Observe(metrics.SinceInMicroseconds(start)) }