testcontainers

package
v0.3.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package testcontainers implements utility functions for running tests with TestContainers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerStats

type ContainerStats struct {
	Timestamp         time.Time
	CPUUsageTotal     uint64
	CPUUsageInKernel  uint64
	CPUUsageUser      uint64
	CPUPercentage     float64
	MemoryUsage       uint64
	MemoryMaxUsage    uint64
	MemoryLimit       uint64
	MemoryPercentage  float64
	NetworkRxBytes    uint64
	NetworkTxBytes    uint64
	BlockIOReadBytes  uint64
	BlockIOWriteBytes uint64
}

ContainerStats defines a summary of the container's starts

func Stats

func Stats(ctx context.Context, containerID string) (ContainerStats, error)

Stats works as Docker Stats command and retrieves a summary of container resource usage. As CPU measurement are accumulated, in order to calculate CPU percentage, two samples are taken a second apart and the incremental usage is used for estimating the percentage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL