analyzer

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package analyzer provides functionality for analyzing the health relationships between CL and EL clients. It helps identify root causes of client failures by detecting patterns where:

1. For CL clients: If an EL client is failing with multiple CL clients, it's likely the root cause 2. For EL clients: If the target EL client is failing with multiple CL clients, it's likely the root cause

The analyzer tracks client relationships and their health status, distinguishing between explained issues (traced back to a root cause) and unexplained issues that may need further investigation.

Example usage:

analyzer := NewAnalyzer("geth", ClientTypeEL)
analyzer.AddNodeStatus("lighthouse-geth-1", false)
analyzer.AddNodeStatus("prysm-geth-1", false)
result := analyzer.Analyze()

Index

Constants

View Source
const (
	// MinFailuresForRootCause is the minimum number of failures needed to consider something a root cause.
	MinFailuresForRootCause = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisResult

type AnalysisResult struct {
	RootCause         []string            // List of clients determined to be root cause.
	UnexplainedIssues []string            // List of issues that can't be explained by root cause.
	AffectedNodes     map[string][]string // Map of issue type to affected nodes.
	RootCauseEvidence map[string]string   // Evidence for why each root cause was determined.
}

AnalysisResult is the result of the analysis.

type Analyzer

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

Analyzer is a struct that analyzes the status of a client.

func NewAnalyzer

func NewAnalyzer(targetClient string, clientType ClientType) *Analyzer

NewAnalyzer creates a new Analyzer.

func (*Analyzer) AddNodeStatus

func (a *Analyzer) AddNodeStatus(nodeName string, isHealthy bool)

AddNodeStatus adds a node status to the analyzer.

func (*Analyzer) Analyze

func (a *Analyzer) Analyze() *AnalysisResult

Analyze analyzes the status of a client.

type ClientPair

type ClientPair struct {
	CLClient string
	ELClient string
}

ClientPair represents a CL-EL client combination.

func (ClientPair) String

func (cp ClientPair) String() string

String returns the string representation of a ClientPair.

type ClientType

type ClientType string

ClientType represents the type of client.

const (
	ClientTypeEL ClientType = "EL"
	ClientTypeCL ClientType = "CL"
)

type NodeStatus

type NodeStatus struct {
	Name      string
	IsHealthy bool
}

NodeStatus represents the status of a node.

type NodeStatusMap

type NodeStatusMap map[ClientPair][]NodeStatus

NodeStatusMap tracks the status of nodes by client pair.

Jump to

Keyboard shortcuts

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