shield

package
v0.0.0-...-c9cfaf6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package shield provides CPU isolation for benchmark execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Shield)

Option configures a shield.

func WithLogger

func WithLogger(l *zap.Logger) Option

WithLogger configures the logger for CPU shield operations.

func WithRoot

func WithRoot(name string) Option

WithRoot configures the root cpuset.

func WithShieldName

func WithShieldName(name string) Option

WithShieldName configures the name of the shield cpuset. Note this is interpreted relative to the root.

func WithShieldNumCPU

func WithShieldNumCPU(n int) Option

WithShieldNumCPU configures the number of CPUs assigned to the shield cpuset.

func WithSystemName

func WithSystemName(name string) Option

WithSystemName configures the name of the system cpuset. Note this is interpreted relative to the root.

func WithSystemNumCPU

func WithSystemNumCPU(n int) Option

WithSystemNumCPU configures the minimum number of CPUs assigned to the system cpuset.

type Shield

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

Shield uses cpusets to setup exclusive access to some CPUs.

func NewShield

func NewShield(opts ...Option) *Shield

NewShield builds a CPU shield.

func (*Shield) Apply

func (s *Shield) Apply() error

Apply the configured shielding.

func (*Shield) Available

func (s *Shield) Available() bool

Available reports whether the shield mechanism can be applied. Note this is a rudimentary check that the environment supports cpusets at all, it is still possible that applying the shield would error.

func (*Shield) Name

func (s *Shield) Name() string

Name of tuning method.

func (*Shield) Reset

func (s *Shield) Reset() error

Reset restores cpuset configuration to the state prior to shielding.

func (*Shield) ShieldName

func (s *Shield) ShieldName() string

ShieldName returns the name of the shield cpuset.

Jump to

Keyboard shortcuts

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