blackbox

package
v1.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	HttpReliability               = "blackbox_http_reliability"
	MalfunctioningMetricsTotal    = "blackbox_malfunctioning_metrics_total"
	BlackboxPerformanceTestCanary = "blackbox_performance_canary"
	BlackboxHTTPReliability       = "blackbox_http_reliability"
	BlackboxPerformanceLatency    = "blackbox_performance_latency"
	BlackboxPerformanceCount      = "blackbox_performance_count"
)
View Source
const (
	// https://play.golang.org/p/Qroq0HGXjdL
	MAGIC_METRIC_NAME_NODE_1_OF_6 = "blackbox_test_metric_001"
	MAGIC_METRIC_NAME_NODE_2_OF_6 = "blackbox_test_metric_002"
	MAGIC_METRIC_NAME_NODE_3_OF_6 = "blackbox_test_metric_005"
	MAGIC_METRIC_NAME_NODE_4_OF_6 = "blackbox_test_metric_007"
	MAGIC_METRIC_NAME_NODE_5_OF_6 = "blackbox_test_metric_021"
	MAGIC_METRIC_NAME_NODE_6_OF_6 = "blackbox_test_metric_003"
)

Variables

This section is empty.

Functions

func MagicMetricNames

func MagicMetricNames() []string

Types

type Config

type Config struct {
	EmissionInterval time.Duration `env:"EMISSION_INTERVAL, required, report"`
	SampleInterval   time.Duration `env:"SAMPLE_INTERVAL, required, report"`
	WindowInterval   time.Duration `env:"WINDOW_INTERVAL, required, report"`
	WindowLag        time.Duration `env:"WINDOW_LAG, required, report"`
	SourceId         string        `env:"SOURCE_ID, required, report"`

	HealthPort             int    `env:"HEALTH_PORT, report"`
	CfBlackboxEnabled      bool   `env:"CF_BLACKBOX_ENABLED, report"`
	MetricStoreHTTPAddr    string `env:"METRIC_STORE_HTTP_ADDR, required, report"`
	MetricStoreIngressAddr string `env:"METRIC_STORE_INGRESS_ADDR, required, report"`
	UaaAddr                string `env:"UAA_ADDR, report"`
	ClientID               string `env:"CLIENT_ID, report"`
	ClientSecret           string `env:"CLIENT_SECRET"`
	SkipTLSVerify          bool   `env:"SKIP_TLS_VERIFY, report"`

	MetricStoreGrpcAddr   string `env:"METRIC_STORE_GRPC_ADDR, required, report"`
	TLS                   sharedtls.TLS
	MetricStoreMetricsTLS MetricStoreMetricsTLS

	LogLevel string `env:"LOG_LEVEL,                      report"`
}

func LoadConfig

func LoadConfig() *Config

type MetricStoreMetricsTLS

type MetricStoreMetricsTLS struct {
	CAPath   string `env:"METRIC_STORE_METRICS_CA_PATH, required, report"`
	CertPath string `env:"METRIC_STORE_METRICS_CERT_PATH, required, report"`
	KeyPath  string `env:"METRIC_STORE_METRICS_KEY_PATH, required, report"`
}

type PerformanceCalculator

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

func NewPerformanceCalculator

func NewPerformanceCalculator(cfg *Config, log *logger.Logger, debugRegistrar *debug.Registrar) *PerformanceCalculator

func (*PerformanceCalculator) Calculate

func (*PerformanceCalculator) CalculatePerformance

func (pc *PerformanceCalculator) CalculatePerformance(egressClient QueryableClient, stopChan chan bool)

func (*PerformanceCalculator) EmitPerformanceTestMetrics

func (pc *PerformanceCalculator) EmitPerformanceTestMetrics(sourceId string, emissionInterval time.Duration, ingressClient *ingressclient.IngressClient, stopChan chan bool)

type PerformanceMetrics

type PerformanceMetrics struct {
	Latency   time.Duration
	Magnitude int
}

type QueryableClient

type QueryableClient interface {
	Query(ctx context.Context, query string, ts time.Time) (model.Value, prom_api_client.Warnings, error)
	LabelValues(context.Context, string) (model.LabelValues, api.Warnings, error)
}

type ReliabilityCalculator

type ReliabilityCalculator struct {
	SampleInterval   time.Duration
	WindowInterval   time.Duration
	WindowLag        time.Duration
	EmissionInterval time.Duration
	SourceId         string
	Log              *logger.Logger
	DebugRegistrar   *debug.Registrar
}

func (ReliabilityCalculator) Calculate

func (rc ReliabilityCalculator) Calculate(qc QueryableClient) (float64, error)

func (*ReliabilityCalculator) CalculateReliability

func (rc *ReliabilityCalculator) CalculateReliability(egressClient QueryableClient, stopChan chan bool)

func (ReliabilityCalculator) CountMetricPoints

func (rc ReliabilityCalculator) CountMetricPoints(metricName string, client QueryableClient) (uint64, error)

func (*ReliabilityCalculator) EmitReliabilityMetrics

func (rc *ReliabilityCalculator) EmitReliabilityMetrics(ingressClient *ingressclient.IngressClient, stopChan chan bool)

func (ReliabilityCalculator) ExpectedSamples

func (rc ReliabilityCalculator) ExpectedSamples() float64

Jump to

Keyboard shortcuts

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