Add event handler for each mutator

Collect additional metrics for individual mutators in order to
understand impact of individual mutators.

Test: m nothing
Change-Id: Ic3ecb1e79a79dd665c9f60d29f0dfd3732481c2d
This commit is contained in:
Liz Kammer 2023-02-13 10:01:53 -05:00
parent 073f69d723
commit a988f08000

View file

@ -2820,6 +2820,8 @@ func (c *Context) runMutators(ctx context.Context, config interface{}) (deps []s
pprof.Do(ctx, pprof.Labels("blueprint", "runMutators"), func(ctx context.Context) { pprof.Do(ctx, pprof.Labels("blueprint", "runMutators"), func(ctx context.Context) {
for _, mutator := range c.mutatorInfo { for _, mutator := range c.mutatorInfo {
pprof.Do(ctx, pprof.Labels("mutator", mutator.name), func(context.Context) { pprof.Do(ctx, pprof.Labels("mutator", mutator.name), func(context.Context) {
c.BeginEvent(mutator.name)
defer c.EndEvent(mutator.name)
var newDeps []string var newDeps []string
if mutator.topDownMutator != nil { if mutator.topDownMutator != nil {
newDeps, errs = c.runMutator(config, mutator, topDownMutator) newDeps, errs = c.runMutator(config, mutator, topDownMutator)