simulation

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedProfile added in v0.2.0

type AdvancedProfile struct {
	ActiveFaultProfile string             `json:"active_fault_profile,omitempty"`
	FaultMatches       []FaultMatch       `json:"fault_matches,omitempty"`
	BlastRadius        *BlastRadius       `json:"blast_radius,omitempty"`
	Endpoints          []EndpointAdvanced `json:"endpoints,omitempty"`
	Paths              []PathAdvanced     `json:"paths,omitempty"`
	Edges              []EdgeAdvanced     `json:"edges,omitempty"`
}

type AnalysisOutput

type AnalysisOutput struct {
	Profiles               []ProfileOutput `json:"profiles"`
	CrossProfileWeighted   float64         `json:"cross_profile_weighted_aggregate"`
	CrossProfileUnweighted float64         `json:"cross_profile_unweighted_aggregate"`
}

func RunArtifactProfiles added in v0.2.0

func RunArtifactProfiles(loaded artifact.Loaded, params AnalysisParams) (AnalysisOutput, error)

func RunProfiles

func RunProfiles(mdl model.ResilienceModel, params AnalysisParams) (AnalysisOutput, error)

type AnalysisParams

type AnalysisParams struct {
	Seed             int64
	JourneyOverrides map[string][][]string
	PredicateSet     map[string]predicates.Definition
	DefaultWeights   map[string]float64
	FaultContract    *faults.Contract
	Profiles         []ProfileParams
}

type AssertionResult added in v0.2.0

type AssertionResult struct {
	Metric      string                 `json:"metric"`
	Target      faults.AssertionTarget `json:"target"`
	Op          string                 `json:"op"`
	Expected    float64                `json:"expected"`
	Status      string                 `json:"status"`
	Available   bool                   `json:"available"`
	ActualValue float64                `json:"actual_value,omitempty"`
	Reason      string                 `json:"reason,omitempty"`
}

type BlastRadius added in v0.2.0

type BlastRadius struct {
	ServiceCount  MetricInt `json:"service_count"`
	EndpointCount MetricInt `json:"endpoint_count"`
	ServiceIDs    []string  `json:"service_ids,omitempty"`
	EndpointIDs   []string  `json:"endpoint_ids,omitempty"`
}

type EdgeAdvanced added in v0.2.0

type EdgeAdvanced struct {
	EdgeID                 string      `json:"edge_id"`
	MaxAmplificationFactor MetricFloat `json:"max_amplification_factor"`
}

type EndpointAdvanced added in v0.2.0

type EndpointAdvanced struct {
	EndpointID             string      `json:"endpoint_id"`
	ExpectedSuccessRate    MetricFloat `json:"expected_success_rate"`
	MaxAmplificationFactor MetricFloat `json:"max_amplification_factor"`
}

type FaultMatch added in v0.2.0

type FaultMatch struct {
	FaultType                 string          `json:"fault_type"`
	Selector                  faults.Selector `json:"selector"`
	MatchedServiceIDs         []string        `json:"matched_service_ids,omitempty"`
	MatchedPlacementBucketIDs []string        `json:"matched_placement_bucket_ids,omitempty"`
	MatchedEdgeIDs            []string        `json:"matched_edge_ids,omitempty"`
	MatchedEndpointIDs        []string        `json:"matched_endpoint_ids,omitempty"`
	MatchedSharedResources    []string        `json:"matched_shared_resources,omitempty"`
}

type MetricFloat added in v0.2.0

type MetricFloat struct {
	Available  bool    `json:"available"`
	Value      float64 `json:"value,omitempty"`
	Reason     string  `json:"reason,omitempty"`
	Provenance string  `json:"provenance,omitempty"`
}

type MetricInt added in v0.2.0

type MetricInt struct {
	Available  bool   `json:"available"`
	Value      int    `json:"value,omitempty"`
	Reason     string `json:"reason,omitempty"`
	Provenance string `json:"provenance,omitempty"`
}

type Output

type Output struct {
	EndpointAvailability map[string]float64
	OverallAvailability  float64
}

func Run

func Run(mdl model.ResilienceModel, params Params) (Output, error)

type Params

type Params struct {
	Trials             int
	Seed               int64
	FailureProbability float64
	JourneyOverrides   map[string][][]string
}

type PathAdvanced added in v0.2.0

type PathAdvanced struct {
	PathID                 string      `json:"path_id"`
	Services               []string    `json:"services"`
	EdgeIDs                []string    `json:"edge_ids"`
	ExpectedSuccessRate    MetricFloat `json:"expected_success_rate"`
	MaxAmplificationFactor MetricFloat `json:"max_amplification_factor"`
	TimeoutMismatchCount   MetricInt   `json:"timeout_mismatch_count"`
}

type ProfileOutput

type ProfileOutput struct {
	Name                 string             `json:"name"`
	Trials               int                `json:"trials"`
	Seed                 int64              `json:"seed"`
	SamplingMode         string             `json:"sampling_mode"`
	FailureProbability   float64            `json:"failure_probability,omitempty"`
	FixedKFailures       int                `json:"fixed_k_failures,omitempty"`
	FaultProfile         string             `json:"fault_profile,omitempty"`
	EndpointAvailability map[string]float64 `json:"endpoint_availability"`
	EndpointWeights      map[string]float64 `json:"endpoint_weights,omitempty"`
	WeightedAggregate    float64            `json:"weighted_aggregate"`
	UnweightedAggregate  float64            `json:"unweighted_aggregate"`
	Assertions           []AssertionResult  `json:"assertions,omitempty"`
	Advanced             *AdvancedProfile   `json:"advanced,omitempty"`
}

type ProfileParams

type ProfileParams struct {
	Name               string
	Trials             int
	Seed               int64
	SamplingMode       string
	FailureProbability float64
	FixedKFailures     int
	FaultProfile       string
	EndpointWeights    map[string]float64
}

Jump to

Keyboard shortcuts

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