utils

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HAProxyCommand

func HAProxyCommand(socket string, observer func(duration time.Duration), command ...string) ([]string, error)

HAProxyCommand ...

Types

type Proc added in v0.12.1

type Proc struct {
	Type    string
	PID     int
	RPID    int
	Reloads int
}

Proc ...

type ProcTable added in v0.12.1

type ProcTable struct {
	Master     Proc
	Workers    []Proc
	OldWorkers []Proc
}

ProcTable ...

func HAProxyProcs added in v0.12.1

func HAProxyProcs(masterSocket string) (*ProcTable, error)

HAProxyProcs reads and converts `show proc` from the master CLI to a ProcTable instance. Waits for the reload to complete while master CLI is down and the attempt to connect leads to a connection refused. Some context: https://www.mail-archive.com/haproxy@formilux.org/msg38415.html The amount of time between attempts increases exponentially between 1ms and 64ms, and aritmetically betweem 128ms and 1s in order to save CPU on long reload events and quit fast on the fastest ones. The whole processing time can be calculated by the caller as the haproxy reload time.

Jump to

Keyboard shortcuts

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