mimir

package
v0.0.0-...-a69e935 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// HostNameLabel represents the hostname label used
	// internally by placement engine
	HostNameLabel = "peloton.placementengine.hostname"
)

Variables

View Source
var (
	// CPUAvailable represents the available cpu in a host offer, each cpu adds 100 %, so a 24 core machine will
	// have 2400 % cpu.
	CPUAvailable = metrics.Type{
		Name:      "cpu_available",
		Unit:      "%",
		Inherited: false,
	}
	// CPUReserved represents the reserved cpu on a host offer or of a task.
	CPUReserved = metrics.Type{
		Name:      "cpu_reserved",
		Unit:      "%",
		Inherited: true,
	}
	// CPUFree represents the free cpu for a host offer.
	CPUFree = metrics.Type{
		Name:      "cpu_free",
		Unit:      "%",
		Inherited: false,
	}

	// GPUAvailable represents the available gpu in a host offer, each gpu adds 100 %, so a 384 core gpu will
	// have 38400 % cpu.
	GPUAvailable = metrics.Type{
		Name:      "gpu_available",
		Unit:      "%",
		Inherited: false,
	}
	// GPUReserved represents the reserved gpu on a host offer or of a task.
	GPUReserved = metrics.Type{
		Name:      "gpu_reserved",
		Unit:      "%",
		Inherited: true,
	}
	// GPUFree represents the free gpu for a host offer.
	GPUFree = metrics.Type{
		Name:      "gpu_free",
		Unit:      "%",
		Inherited: false,
	}

	// MemoryAvailable represents the available memory on a host offer.
	MemoryAvailable = metrics.Type{
		Name:      "memory_available",
		Unit:      "bytes",
		Inherited: false,
	}
	// MemoryReserved represents the reserved memory on a host offer or of a task.
	MemoryReserved = metrics.Type{
		Name:      "memory_reserved",
		Unit:      "bytes",
		Inherited: true,
	}
	// MemoryFree represents the free memory for a host offer.
	MemoryFree = metrics.Type{
		Name:      "memory_free",
		Unit:      "bytes",
		Inherited: false,
	}

	// DiskAvailable represents the available disk on a host offer.
	DiskAvailable = metrics.Type{
		Name:      "disk_available",
		Unit:      "bytes",
		Inherited: false,
	}
	// DiskReserved represents the reserved disk on a host offer or of a task.
	DiskReserved = metrics.Type{
		Name:      "disk_reserved",
		Unit:      "bytes",
		Inherited: true,
	}
	// DiskFree represents the free disk for a host offer.
	DiskFree = metrics.Type{
		Name:      "disk_free",
		Unit:      "bytes",
		Inherited: false,
	}

	// PortsAvailable represents the available ports on a host offer.
	PortsAvailable = metrics.Type{
		Name:      "ports_available",
		Unit:      "#",
		Inherited: false,
	}
	// PortsReserved represents the reserved ports on a host offer or of a task.
	PortsReserved = metrics.Type{
		Name:      "ports_reserved",
		Unit:      "#",
		Inherited: true,
	}
	// PortsFree represents the free ports for a host offer.
	PortsFree = metrics.Type{
		Name:      "ports_free",
		Unit:      "#",
		Inherited: false,
	}
)

Functions

This section is empty.

Types

type Entity

type Entity struct {
	Name      string             `json:"name"`
	Relations map[string]int     `json:"relations"`
	Metrics   map[string]float64 `json:"metrics"`
}

Entity is a helper to be able to make structured logging of the Mimir library types.

func DumpEntity

func DumpEntity(entity *placement.Entity) *Entity

DumpEntity converts a Mimir entity into an entity who's structure we can log.

type Group

type Group struct {
	Name      string             `json:"name"`
	Labels    map[string]int     `json:"labels"`
	Metrics   map[string]float64 `json:"metrics"`
	Relations map[string]int     `json:"relations"`
	Entities  map[string]*Entity `json:"entities"`
}

Group is a helper to be able to make structured logging of the Mimir library types.

func DumpGroup

func DumpGroup(group *placement.Group) *Group

DumpGroup converts a Mimir group into a group who's structure we can log.

Jump to

Keyboard shortcuts

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