awsecscontainermetrics

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributeECSDockerName   = "ecs.docker-name"
	AttributeECSCluster      = "ecs.cluster"
	AttributeECSTaskARN      = "ecs.task-arn"
	AttributeECSTaskID       = "ecs.task-id"
	AttributeECSTaskFamily   = "ecs.task-definition-family"
	AttributeECSTaskRevesion = "ecs.task-definition-version"
	AttributeECSServiceName  = "ecs.service"

	ContainerMetricsLabelLen = 3
	TaskMetricsLabelLen      = 6
)

Variables

This section is empty.

Functions

func GenerateDummyMetrics

func GenerateDummyMetrics() consumerdata.MetricsData

GenerateDummyMetrics generates some dummy metrics

Types

type CPUStats added in v0.11.0

type CPUStats struct {
	CPUUsage       CPUUsage `json:"cpu_usage,omitempty"`
	OnlineCpus     *uint64  `json:"online_cpus,omitempty"`
	SystemCPUUsage *uint64  `json:"system_cpu_usage,omitempty"`
	CPUUtilized    *uint64
	CPUReserved    *uint64
}

CPUStats defines Cpu stats

type CPUUsage added in v0.11.0

type CPUUsage struct {
	TotalUsage        *uint64   `json:"total_usage,omitempty"`
	UsageInKernelmode *uint64   `json:"usage_in_kernelmode,omitempty"`
	UsageInUserMode   *uint64   `json:"usage_in_usermode,omitempty"`
	PerCPUUsage       []*uint64 `json:"percpu_usage,omitempty"`
}

CPUUsage defines raw Cpu usage

type ContainerMetadata added in v0.11.0

type ContainerMetadata struct {
	DockerID      string            `json:"DockerId,omitempty"`
	ContainerName string            `json:"Name,omitempty"`
	DockerName    string            `json:"DockerName,omitempty"`
	Image         string            `json:"Image,omitempty"`
	Labels        map[string]string `json:"Labels,omitempty"`
	Limits        Limit             `json:"Limits,omitempty"`
}

ContainerMetadata defines container metadata for a container

type ContainerStats added in v0.11.0

type ContainerStats struct {
	Name string `json:"name"`
	ID   string `json:"id"`

	Memory      MemoryStats             `json:"memory_stats,omitempty"`
	Disk        DiskStats               `json:"blkio_stats,omitempty"`
	Network     map[string]NetworkStats `json:"networks,omitempty"`
	NetworkRate NetworkRateStats        `json:"network_rate_stats,omitempty"`
	CPU         CPUStats                `json:"cpu_stats,omitempty"`
}

ContainerStats defines the structure for container stats

type DiskStats added in v0.11.0

type DiskStats struct {
	IoServiceBytesRecursives []IoServiceBytesRecursive `json:"io_service_bytes_recursive,omitempty"`
}

DiskStats defines the storage stats

type ECSMetrics added in v0.11.0

type ECSMetrics struct {
	MemoryUsage    uint64
	MemoryMaxUsage uint64
	MemoryLimit    uint64
	MemoryUtilized uint64
	MemoryReserved uint64

	CPUTotalUsage        uint64
	CPUUsageInKernelmode uint64
	CPUUsageInUserMode   uint64
	CPUOnlineCpus        uint64
	SystemCPUUsage       uint64
	NumOfCPUCores        uint64
	CPUReserved          float64
	CPUUtilized          float64

	NetworkRateRxBytesPerSecond float64
	NetworkRateTxBytesPerSecond float64

	NetworkRxBytes   uint64
	NetworkRxPackets uint64
	NetworkRxErrors  uint64
	NetworkRxDropped uint64
	NetworkTxBytes   uint64
	NetworkTxPackets uint64
	NetworkTxErrors  uint64
	NetworkTxDropped uint64

	StorageReadBytes  uint64
	StorageWriteBytes uint64
}

ECSMetrics defines the structure container/task level metrics

type IoServiceBytesRecursive added in v0.11.0

type IoServiceBytesRecursive struct {
	Major *uint64 `json:"major,omitempty"`
	Minor *uint64 `json:"minor,omitempty"`
	Op    string  `json:"op,omitempty"`
	Value *uint64 `json:"value,omitempty"`
}

IoServiceBytesRecursive defines the IO device stats

type Limit added in v0.11.0

type Limit struct {
	CPU    *float64 `json:"CPU,omitempty"`
	Memory *uint64  `json:"Memory,omitempty"`
}

Limit defines the Cpu and Memory limts

type MemoryStats added in v0.11.0

type MemoryStats struct {
	Usage          *uint64 `json:"usage,omitempty"`
	MaxUsage       *uint64 `json:"max_usage,omitempty"`
	Limit          *uint64 `json:"limit,omitempty"`
	MemoryUtilized *uint64
	MemoryReserved *uint64
	Stats          map[string]uint64 `json:"stats,omitempty"`
}

MemoryStats defines the memory stats

type NetworkRateStats added in v0.11.0

type NetworkRateStats struct {
	RxBytesPerSecond *float64 `json:"rx_bytes_per_sec,omitempty"`
	TxBytesPerSecond *float64 `json:"tx_bytes_per_sec,omitempty"`
}

NetworkRateStats doesn't come from docker stat. The rates are being calculated in ECS agent

type NetworkStats added in v0.11.0

type NetworkStats struct {
	RxBytes   *uint64 `json:"rx_bytes,omitempty"`
	RxPackets *uint64 `json:"rx_packets,omitempty"`
	RxErrors  *uint64 `json:"rx_errors,omitempty"`
	RxDropped *uint64 `json:"rx_dropped,omitempty"`
	TxBytes   *uint64 `json:"tx_bytes,omitempty"`
	TxPackets *uint64 `json:"tx_packets,omitempty"`
	TxErrors  *uint64 `json:"tx_errors,omitempty"`
	TxDropped *uint64 `json:"tx_dropped,omitempty"`
}

NetworkStats defines the network stats

type TaskMetadata added in v0.11.0

type TaskMetadata struct {
	Cluster  string `json:"Cluster,omitempty"`
	TaskARN  string `json:"TaskARN,omitempty"`
	Family   string `json:"Family,omitempty"`
	Revision string `json:"Revision,omitempty"`

	Limits     Limit               `json:"Limits,omitempty"`
	Containers []ContainerMetadata `json:"Containers,omitempty"`
}

TaskMetadata defines task metadata for a task

type TaskStats added in v0.11.0

type TaskStats struct {
	Memory            MemoryStats
	NetworkRate       NetworkRateStats
	Network           NetworkStats
	CPU               CPUStats
	StorageReadBytes  *uint64
	StorageWriteBytes *uint64
}

TaskStats defines the stats for a task

Jump to

Keyboard shortcuts

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