package resources

import "github.com/moby/buildkit/executor/resources"

Index

Types

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor() (*Monitor, error)

func (*Monitor) Close

func (m *Monitor) Close() error

func (*Monitor) RecordNamespace

func (m *Monitor) RecordNamespace(ns string, opt RecordOpt) (resourcestypes.Recorder, error)

type NetworkSampler

type NetworkSampler interface {
	Sample() (*resourcestypes.NetworkSample, error)
}

type RecordOpt

type RecordOpt struct {
	NetworkSampler NetworkSampler
}

type Sampler

type Sampler[T WithTimestamp] struct {
	// contains filtered or unexported fields
}

func NewSampler

func NewSampler[T WithTimestamp](minInterval time.Duration, maxSamples int, cb func(time.Time) (T, error)) *Sampler[T]

func NewSysSampler

func NewSysSampler() (*Sampler[*resourcestypes.SysSample], error)

func (*Sampler[T]) Close

func (s *Sampler[T]) Close() error

func (*Sampler[T]) Record

func (s *Sampler[T]) Record() *Sub[T]

type Sub

type Sub[T WithTimestamp] struct {
	// contains filtered or unexported fields
}

func (*Sub[T]) Close

func (s *Sub[T]) Close(captureLast bool) ([]T, error)

type SysSampler

type SysSampler = Sub[*resourcestypes.SysSample]

type WithTimestamp

type WithTimestamp interface {
	Timestamp() time.Time
}

Source Files

cpu.go io.go memory.go monitor.go monitor_nolinux.go pids.go sampler.go sys.go sys_nolinux.go

Directories

PathSynopsis
executor/resources/types
Version
v0.13.1
Published
Mar 18, 2024
Platform
js/wasm
Imports
13 packages
Last checked
12 hours ago

Tools for package owners.