goldpinger

package
v0.0.0-...-c66050e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GoldpingerConfig = struct {
	StaticFilePath   string `long:"static-file-path" description:"Folder for serving static files" env:"STATIC_FILE_PATH"`
	KubeConfigPath   string `long:"kubeconfig" description:"Path to kubeconfig file" env:"KUBECONFIG"`
	RefreshInterval  int    `` /* 136-byte string literal not displayed */
	Hostname         string `long:"hostname" description:"Hostname to use" env:"HOSTNAME"`
	PodIP            string `long:"pod-ip" description:"Pod IP to use" env:"POD_IP"`
	PingNumber       uint   `` /* 138-byte string literal not displayed */
	Port             int    `long:"client-port-override" description:"(for testing) use this port when calling other instances" env:"CLIENT_PORT_OVERRIDE"`
	UseHostIP        bool   `long:"use-host-ip" description:"When making the calls, use host ip (defaults to pod ip)" env:"USE_HOST_IP"`
	LabelSelector    string `` /* 146-byte string literal not displayed */
	KubernetesClient *kubernetes.Clientset
	*PodSelecter

	DnsHosts []string `long:"host-to-resolve" description:"A host to attempt dns resolve on (space delimited)" env:"HOSTS_TO_RESOLVE" env-delim:" "`
}{}

GoldpingerConfig represents the configuration for goldpinger

Functions

func CheckAllPods

func CheckAllPods(pods map[string]string) *models.CheckAllResults

func CheckNeighbours

func CheckNeighbours(ps *PodSelecter) *models.CheckResults

CheckNeighbours queries the kubernetes API server for all other goldpinger pods then calls Ping() on each one

func CheckNeighboursNeighbours

func CheckNeighboursNeighbours(ps *PodSelecter) *models.CheckAllResults

CheckNeighboursNeighbours queries the kubernetes API server for all other goldpinger pods then calls Check() on each one

func CountCall

func CountCall(group string, call string)

counts various calls received and made

func CountDnsError

func CountDnsError(host string)

counts instances of dns errors

func CountError

func CountError(errorType string)

counts instances of various errors

func CountHealthyUnhealthyNodes

func CountHealthyUnhealthyNodes(healthy, unhealthy float64)

counts healthy and unhealthy nodes

func GetAllPods

func GetAllPods() map[string]string

GetAllPods returns a map of Pod IP to Host IP based on a label selector defined in config

func GetLabeledKubernetesCallsTimer

func GetLabeledKubernetesCallsTimer() *prometheus.Timer

returns a timer for easy observing of the durations of calls to kubernetes API

func GetLabeledPeersCallsTimer

func GetLabeledPeersCallsTimer(callType, hostIP, podIP string) *prometheus.Timer

returns a timer for easy observing of the duration of calls to peers

func GetStats

func GetStats() *models.PingResults

func HealthCheck

func HealthCheck() *models.HealthCheckResults

func HeatmapHandler

func HeatmapHandler(w http.ResponseWriter, r *http.Request)

HeatmapHandler returns a PNG with a heatmap representation

func PingAllPods

func PingAllPods(pods map[string]string) *models.CheckResults

func StartUpdater

func StartUpdater()

Types

type CheckServicePodsResult

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

type PingAllPodsResult

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

type PodSelecter

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

PodSelecter selects the result of getPods() down to count instances according to a rendezvous hash.

func NewPodSelecter

func NewPodSelecter(count uint, podIP string, getPods func() map[string]string) *PodSelecter

NewPodSelecter creates a new PodSelecter struct.

func (*PodSelecter) SelectPods

func (p *PodSelecter) SelectPods() map[string]string

SelectPods returns a map of pods filtered according to its configuration.

Jump to

Keyboard shortcuts

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