コード例 #1
0
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)
}
コード例 #2
0
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)
}
コード例 #3
0
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)
}
コード例 #4
0
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)
}
コード例 #5
0
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)
}
コード例 #6
0
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)
}
コード例 #7
0
func (in instrumentedDockerInterface) Info() (*docker.Env, error) {
	start := time.Now()
	defer func() {
		metrics.DockerOperationsLatency.WithLabelValues("info").Observe(metrics.SinceInMicroseconds(start))
	}()
	return in.client.Info()
}
コード例 #8
0
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)
}
コード例 #9
0
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)
}
コード例 #10
0
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)
}
コード例 #11
0
// Record the duration of the operation.
func recordOperation(operation string, start time.Time) {
	metrics.DockerOperationsLatency.WithLabelValues(operation).Observe(metrics.SinceInMicroseconds(start))
}