chaosdaemon

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 42 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// StatusOK represents OK status code
	StatusOK = 200
	// StatusOtherError represents Error status code
	StatusOtherError = 1
)
View Source
const (
	// DNSServerConfFile is the default config file for DNS server
	DNSServerConfFile = "/etc/resolv.conf"
)

Variables

This section is empty.

Functions

func GetChildProcesses

func GetChildProcesses(ppid uint32) ([]uint32, error)

GetChildProcesses will return all child processes's pid. Include all generations. only return error when /proc/pid/tasks cannot be read

func ReadCommName

func ReadCommName(pid int) (string, error)

ReadCommName returns the command name of process

func StartServer

func StartServer(conf *Config, reg RegisterGatherer) error

StartServer starts chaos-daemon.

func ToNetlinkNetemAttrs

func ToNetlinkNetemAttrs(netem *pb.Netem) netlink.NetemQdiscAttrs

Types

type Config

type Config struct {
	HTTPPort  int
	GRPCPort  int
	Host      string
	Runtime   string
	Profiling bool
	// contains filtered or unexported fields
}

Config contains the basic chaos daemon configuration.

func (*Config) GrpcAddr

func (c *Config) GrpcAddr() string

Get the grpc address

func (*Config) HttpAddr

func (c *Config) HttpAddr() string

Get the http address

type DaemonServer added in v1.1.0

type DaemonServer struct {
	IPSetLocker *locker.Locker
	// contains filtered or unexported fields
}

DaemonServer represents a grpc server for tc daemon

func NewDaemonServerWithCRClient added in v1.1.0

func NewDaemonServerWithCRClient(crClient crclients.ContainerRuntimeInfoClient) *DaemonServer

NewDaemonServerWithCRClient returns DaemonServer with container runtime client

func (*DaemonServer) ApplyIoChaos added in v1.1.0

func (*DaemonServer) CancelStressors added in v1.1.0

func (s *DaemonServer) CancelStressors(ctx context.Context,
	req *pb.CancelStressRequest) (*empty.Empty, error)

func (*DaemonServer) ContainerGetPid added in v1.1.0

func (s *DaemonServer) ContainerGetPid(ctx context.Context, req *pb.ContainerRequest) (*pb.ContainerResponse, error)

func (*DaemonServer) ContainerKill added in v1.1.0

func (s *DaemonServer) ContainerKill(ctx context.Context, req *pb.ContainerRequest) (*empty.Empty, error)

ContainerKill kills container according to container id in the req

func (*DaemonServer) ExecStressors added in v1.1.0

func (s *DaemonServer) ExecStressors(ctx context.Context,
	req *pb.ExecStressRequest) (*pb.ExecStressResponse, error)

func (*DaemonServer) FlushIPSets added in v1.1.0

func (s *DaemonServer) FlushIPSets(ctx context.Context, req *pb.IPSetsRequest) (*empty.Empty, error)

func (*DaemonServer) RecoverTimeOffset added in v1.1.0

func (s *DaemonServer) RecoverTimeOffset(ctx context.Context, req *pb.TimeRequest) (*empty.Empty, error)

func (*DaemonServer) SetDNSServer added in v1.1.0

func (s *DaemonServer) SetDNSServer(ctx context.Context,
	req *pb.SetDNSServerRequest) (*empty.Empty, error)

func (*DaemonServer) SetIptablesChains added in v1.1.0

func (s *DaemonServer) SetIptablesChains(ctx context.Context, req *pb.IptablesChainsRequest) (*empty.Empty, error)

func (*DaemonServer) SetTcs added in v1.1.0

func (s *DaemonServer) SetTcs(ctx context.Context, in *pb.TcsRequest) (*empty.Empty, error)

func (*DaemonServer) SetTimeOffset added in v1.1.0

func (s *DaemonServer) SetTimeOffset(ctx context.Context, req *pb.TimeRequest) (*empty.Empty, error)

type Edge added in v1.1.0

type Edge struct {
	Source uint32
	Target uint32
	Next   *Edge
}

Edge represents an edge in graph

type Graph added in v1.1.0

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

Graph represents a graph with link list

func NewGraph added in v1.1.0

func NewGraph() *Graph

NewGraph creates a Graph

func (*Graph) Flatten added in v1.1.0

func (g *Graph) Flatten(source uint32) []uint32

Flatten flattens the subtree from source (without checking whether it's a tree)

func (*Graph) Insert added in v1.1.0

func (g *Graph) Insert(source uint32, target uint32)

Insert inserts an Edge into a graph from source to target

func (*Graph) IterFrom added in v1.1.0

func (g *Graph) IterFrom(source uint32) *Edge

IterFrom starts iterating from source node

type RegisterGatherer

type RegisterGatherer interface {
	prometheus.Registerer
	prometheus.Gatherer
}

RegisterGatherer combine prometheus.Registerer and prometheus.Gatherer

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

Response is the body part of HTTP Response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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