Documentation
¶
Overview ¶
Package antagonism provides types and functions for analyzing antagonisms (durations of time in which *victim* work was runnable but didn't run, while *antagonism* work ran instead) within traces.
Index ¶
- func Analyze[T any, CP, SP, DP fmt.Stringer](t trace.Wrapper[T, CP, SP, DP], logger antagonismLogger[T, CP, SP, DP], ...) error
- type ElementarySpanner
- type Group
- func (g *Group[T, CP, SP, DP]) Name() string
- func (g *Group[T, CP, SP, DP]) WithAntagonistElementarySpansFn(...) *Group[T, CP, SP, DP]
- func (g *Group[T, CP, SP, DP]) WithAntagonistFinder(antagonistFinder *trace.SpanFinder[T, CP, SP, DP]) *Group[T, CP, SP, DP]
- func (g *Group[T, CP, SP, DP]) WithVictimElementarySpansFn(...) *Group[T, CP, SP, DP]
- func (g *Group[T, CP, SP, DP]) WithVictimFinder(victimFinder *trace.SpanFinder[T, CP, SP, DP]) *Group[T, CP, SP, DP]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ElementarySpanner ¶
type ElementarySpanner[T any, CP, SP, DP fmt.Stringer] interface { ElementarySpan() trace.ElementarySpan[T, CP, SP, DP] // contains filtered or unexported methods }
ElementarySpanner wraps a Trace elementary span for antagonism logging.
type Group ¶
Group specifies a single 'antagonism group'.
func (*Group[T, CP, SP, DP]) WithAntagonistElementarySpansFn ¶
func (g *Group[T, CP, SP, DP]) WithAntagonistElementarySpansFn( fn func(trace.Wrapper[T, CP, SP, DP]) ([]trace.ElementarySpan[T, CP, SP, DP], error), ) *Group[T, CP, SP, DP]
WithAntagonistElementarySpansFn specifies that the receiver's set of antagonists should be generated, as a list of ElementarySpans, by the provided function. If the receiver has already specified an antagonist SpanFinder or elementary span function, the previous value is overwritten.
func (*Group[T, CP, SP, DP]) WithAntagonistFinder ¶
func (g *Group[T, CP, SP, DP]) WithAntagonistFinder( antagonistFinder *trace.SpanFinder[T, CP, SP, DP], ) *Group[T, CP, SP, DP]
WithAntagonistFinder specifies that the receiver's set of antagonists should match the provided SpanFinder, returning the receiver to facilitate streaming. If the receiver has already specified an antagonist SpanFinder or elementary span function, the previous value is overwritten.
func (*Group[T, CP, SP, DP]) WithVictimElementarySpansFn ¶
func (g *Group[T, CP, SP, DP]) WithVictimElementarySpansFn( fn func(trace.Wrapper[T, CP, SP, DP]) ([]trace.ElementarySpan[T, CP, SP, DP], error), ) *Group[T, CP, SP, DP]
WithVictimElementarySpansFn specifies that the receiver's set of victims should be generated, as a list of ElementarySpans, by the provided function. If the receiver has already specified a victim SpanFinder or elementary span function, the previous value is overwritten.
func (*Group[T, CP, SP, DP]) WithVictimFinder ¶
func (g *Group[T, CP, SP, DP]) WithVictimFinder( victimFinder *trace.SpanFinder[T, CP, SP, DP], ) *Group[T, CP, SP, DP]
WithVictimFinder specifies that the receiver's set of victims should match the provided SpanFinder, returning the receiver to facilitate streaming. If the receiver has already specified a victim SpanFinder or elementary span function, the previous value is overwritten.