Documentation
¶
Overview ¶
Package model holds the attempt arithmetic and the report types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllClasses = []Class{ClassConnect, Class503, Class5xx, ClassTimeout}
Functions ¶
func SortFindings ¶
func SortFindings(fs []*Finding)
SortFindings orders by attempts (unbounded first), then anchor.
Types ¶
type Attempts ¶
type Attempts struct {
Kind Kind
N int // Exact, or the largest known candidate for Unknown
Deadline time.Duration // TimeBounded
Ref string // Unknown: what it depends on, e.g. "tools.MediaProviderEntry.MaxRetries"
ConfigKey string // Unknown: struct tag key when the field is loaded from config, e.g. "max_retries"
Candidates []int // Unknown: constants we did see stored
Note string // e.g. "conditional-on-context"
}
Attempts is how many times one layer sends a request, including the first try.
func Mul ¶
Mul multiplies two layers. Unbounded or TimeBounded anywhere makes the product Unbounded. Unknown stays Unknown and carries the known part.
type Class ¶
type Class string
Failure classes a fault can fall into. Code layers retry on any of them.
type Finding ¶
type Finding struct {
Anchor string `json:"anchor"` // where the outermost layer is
Outbound string `json:"outbound"` // the call that hits the network
OutboundAt string `json:"outbound_at"`
Host string `json:"host,omitempty"`
HostUnres bool `json:"host_unresolved,omitempty"`
Layers []Layer `json:"layers"` // outermost first
Product map[Class]string `json:"attempts_by_class,omitempty"`
Total string `json:"attempts"` // max over classes
TotalN int `json:"attempts_n"`
Bounded bool `json:"bounded"`
Unresolved bool `json:"unresolved,omitempty"`
Path []string `json:"path"`
Flags []string `json:"flags,omitempty"`
Assume []string `json:"assumptions,omitempty"`
// contains filtered or unexported fields
}
Finding is one outermost retry region paired with one outbound call site.
func (*Finding) ProductFor ¶
ProductFor returns the computed product for one class.
type Layer ¶
type Layer struct {
Kind LayerKind `json:"kind"`
Attempts Attempts `json:"-"`
Count string `json:"attempts"`
// RetryOn nil means "any error" (code layers).
RetryOn map[Class]bool `json:"-"`
RetryOnStr string `json:"retry_on,omitempty"`
PerTry time.Duration `json:"per_try_timeout,omitempty"`
Timeout time.Duration `json:"timeout,omitempty"`
Backoff bool `json:"backoff"`
Jitter bool `json:"jitter"`
IgnoresCtx bool `json:"ignores_context,omitempty"`
Source string `json:"source"` // declared | library-default | mesh-default (assumed)
Where string `json:"where"` // file:line or config resource
Loop string `json:"loop,omitempty"` // wrapper layer: where its retry loop is
Func string `json:"func,omitempty"`
}
Layer is one retrying component on the way from a caller to the wire.
type LayerKind ¶
type LayerKind string
LayerKind says where a retry layer lives.
const ( LayerCodeLoop LayerKind = "code-loop" // hand-rolled loop in a function LayerCodeWrapper LayerKind = "code-wrapper" // a retry helper called with a func argument LayerLibrary LayerKind = "library" // e.g. go-retryablehttp, aws-sdk-go-v2 LayerMesh LayerKind = "istio" // caller sidecar, from a VirtualService or the mesh default LayerEnvoy LayerKind = "envoy" // envoy static route retry_policy )