github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/internal/trace/traceviewer/mmu.go (about) 1 // Copyright 2023 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Minimum mutator utilization (MMU) graphing. 6 7 // TODO: 8 // 9 // In worst window list, show break-down of GC utilization sources 10 // (STW, assist, etc). Probably requires a different MutatorUtil 11 // representation. 12 // 13 // When a window size is selected, show a second plot of the mutator 14 // utilization distribution for that window size. 15 // 16 // Render plot progressively so rough outline is visible quickly even 17 // for very complex MUTs. Start by computing just a few window sizes 18 // and then add more window sizes. 19 // 20 // Consider using sampling to compute an approximate MUT. This would 21 // work by sampling the mutator utilization at randomly selected 22 // points in time in the trace to build an empirical distribution. We 23 // could potentially put confidence intervals on these estimates and 24 // render this progressively as we refine the distributions. 25 26 package traceviewer 27 28 import ( 29 "github.com/shogo82148/std/internal/trace" 30 "github.com/shogo82148/std/net/http" 31 ) 32 33 type MutatorUtilFunc func(trace.UtilFlags) ([][]trace.MutatorUtil, error) 34 35 func MMUHandlerFunc(ranges []Range, f MutatorUtilFunc) http.HandlerFunc