@@ -4,6 +4,14 @@ import (
44 "runtime/metrics"
55)
66
7+ func floatseq (n int ) []float64 {
8+ seq := make ([]float64 , n )
9+ for i := range n {
10+ seq [i ] = float64 (i )
11+ }
12+ return seq
13+ }
14+
715var garbageCollectionLayout = Scatter {
816 Name : "garbage collection" ,
917 Title : "GC Memory Summary" ,
@@ -202,38 +210,6 @@ func sizeClassesLayout(samples []metrics.Sample) Heatmap {
202210 }
203211}
204212
205- func gcPausesLayout (samples []metrics.Sample ) Heatmap {
206- idxgcpauses := metricIdx ["/sched/pauses/total/gc:seconds" ]
207-
208- gcpauses := samples [idxgcpauses ].Value .Float64Histogram ()
209- histfactor := downsampleFactor (len (gcpauses .Buckets ), maxBuckets )
210- buckets := downsampleBuckets (gcpauses , histfactor )
211-
212- return Heatmap {
213- Name : "TODO(set later)" ,
214- Title : "Stop-the-world Pause Latencies" ,
215- Type : "heatmap" ,
216- UpdateFreq : 5 ,
217- Colorscale : PinkShades ,
218- Buckets : floatseq (len (buckets )),
219- CustomData : buckets ,
220- Hover : HeapmapHover {
221- YName : "pause duration" ,
222- YUnit : "duration" ,
223- ZName : "pauses" ,
224- },
225- Layout : HeatmapLayout {
226- YAxis : HeatmapYaxis {
227- Title : "pause duration" ,
228- TickMode : "array" ,
229- TickVals : []float64 {6 , 13 , 20 , 26 , 33 , 39.5 , 46 , 53 , 60 , 66 , 73 , 79 , 86 },
230- TickText : []float64 {1e-7 , 1e-6 , 1e-5 , 1e-4 , 1e-3 , 5e-3 , 1e-2 , 5e-2 , 1e-1 , 5e-1 , 1 , 5 , 10 },
231- },
232- },
233- InfoText : `This heatmap shows the distribution of individual GC-related stop-the-world pause latencies, uses <b>/sched/pauses/total/gc:seconds</b>,.` ,
234- }
235- }
236-
237213func runnableTimeLayout (samples []metrics.Sample ) Heatmap {
238214 idxschedlat := metricIdx ["/sched/latencies:seconds" ]
239215
@@ -599,48 +575,86 @@ var allocFreeRatesLayout = Scatter{
599575<i>Frees per second</i> is similarly derived from <b>/gc/heap/frees:objects</b>.` ,
600576}
601577
602- func stoppingPausesGCLayout (samples []metrics.Sample ) Heatmap {
603- idxstoppinggc := metricIdx ["/sched/pauses/stopping /gc:seconds" ]
578+ func gcTotalPausesLayout (samples []metrics.Sample ) Heatmap {
579+ idxgcpauses := metricIdx ["/sched/pauses/total /gc:seconds" ]
604580
605- stoppinggc := samples [idxstoppinggc ].Value .Float64Histogram ()
606- histfactor := downsampleFactor (len (stoppinggc .Buckets ), maxBuckets )
607- buckets := downsampleBuckets (stoppinggc , histfactor )
581+ gcpauses := samples [idxgcpauses ].Value .Float64Histogram ()
582+ histfactor := downsampleFactor (len (gcpauses .Buckets ), maxBuckets )
583+ buckets := downsampleBuckets (gcpauses , histfactor )
608584
609585 return Heatmap {
610586 Name : "TODO(set later)" ,
611- Title : "Stop-the-world Stopping Latencies (GC )" ,
587+ Title : "Stop-the-world Pause Latencies (Total )" ,
612588 Type : "heatmap" ,
613589 UpdateFreq : 5 ,
614590 Colorscale : PinkShades ,
615591 Buckets : floatseq (len (buckets )),
616592 CustomData : buckets ,
617593 Hover : HeapmapHover {
618- YName : "stopping duration" ,
594+ YName : "pause duration" ,
619595 YUnit : "duration" ,
620596 ZName : "pauses" ,
621597 },
622598 Layout : HeatmapLayout {
623599 YAxis : HeatmapYaxis {
624- Title : "stopping duration" ,
600+ Title : "pause duration" ,
625601 TickMode : "array" ,
626602 TickVals : []float64 {6 , 13 , 20 , 26 , 33 , 39.5 , 46 , 53 , 60 , 66 , 73 , 79 , 86 },
627603 TickText : []float64 {1e-7 , 1e-6 , 1e-5 , 1e-4 , 1e-3 , 5e-3 , 1e-2 , 5e-2 , 1e-1 , 5e-1 , 1 , 5 , 10 },
628604 },
629605 },
630- InfoText : `This heatmap shows the distribution of individual GC-related stop-the-world stopping latencies. This is the time it takes from deciding to stop the world until all Ps are stopped. This is a subset of the total GC-related stop-the-world time. During this time, some threads may be executing. Uses <b>/sched/pauses/stopping/gc:seconds</b>.` ,
606+ InfoText : `This heatmap shows the distribution of individual <b>GC-related</b> stop-the-world <i>pause latencies</i>.
607+ This is the time from deciding to stop the world until the world is started again.
608+ Some of this time is spent getting all threads to stop (this is measured directly in <i>/sched/pauses/stopping/gc:seconds</i>), during which some threads may still be running.
609+ Uses <b>/sched/pauses/total/gc:seconds</b>.` ,
631610 }
632611}
633612
634- func stoppingPausesOtherLayout (samples []metrics.Sample ) Heatmap {
635- idxstoppingother := metricIdx ["/sched/pauses/stopping /other:seconds" ]
613+ func otherTotalPausesLayout (samples []metrics.Sample ) Heatmap {
614+ idxtotalother := metricIdx ["/sched/pauses/total /other:seconds" ]
636615
637- stoppingother := samples [idxstoppingother ].Value .Float64Histogram ()
638- histfactor := downsampleFactor (len (stoppingother .Buckets ), maxBuckets )
639- buckets := downsampleBuckets (stoppingother , histfactor )
616+ totalother := samples [idxtotalother ].Value .Float64Histogram ()
617+ histfactor := downsampleFactor (len (totalother .Buckets ), maxBuckets )
618+ buckets := downsampleBuckets (totalother , histfactor )
640619
641620 return Heatmap {
642621 Name : "TODO(set later)" ,
643- Title : "Stop-the-world Stopping Latencies (Other)" ,
622+ Title : "Stop-the-world Pause Latencies (Other)" ,
623+ Type : "heatmap" ,
624+ UpdateFreq : 5 ,
625+ Colorscale : PinkShades ,
626+ Buckets : floatseq (len (buckets )),
627+ CustomData : buckets ,
628+ Hover : HeapmapHover {
629+ YName : "pause duration" ,
630+ YUnit : "duration" ,
631+ ZName : "pauses" ,
632+ },
633+ Layout : HeatmapLayout {
634+ YAxis : HeatmapYaxis {
635+ Title : "pause duration" ,
636+ TickMode : "array" ,
637+ TickVals : []float64 {6 , 13 , 20 , 26 , 33 , 39.5 , 46 , 53 , 60 , 66 , 73 , 79 , 86 },
638+ TickText : []float64 {1e-7 , 1e-6 , 1e-5 , 1e-4 , 1e-3 , 5e-3 , 1e-2 , 5e-2 , 1e-1 , 5e-1 , 1 , 5 , 10 },
639+ },
640+ },
641+ InfoText : `This heatmap shows the distribution of individual <b>non-GC-related</b> stop-the-world <i>pause latencies</i>.
642+ This is the time from deciding to stop the world until the world is started again.
643+ Some of this time is spent getting all threads to stop (measured directly in <i>/sched/pauses/stopping/other:seconds</i>).
644+ Uses <b>/sched/pauses/total/other:seconds</b>.` ,
645+ }
646+ }
647+
648+ func gcStoppingPausesLayout (samples []metrics.Sample ) Heatmap {
649+ idxstoppinggc := metricIdx ["/sched/pauses/stopping/gc:seconds" ]
650+
651+ stoppinggc := samples [idxstoppinggc ].Value .Float64Histogram ()
652+ histfactor := downsampleFactor (len (stoppinggc .Buckets ), maxBuckets )
653+ buckets := downsampleBuckets (stoppinggc , histfactor )
654+
655+ return Heatmap {
656+ Name : "TODO(set later)" ,
657+ Title : "Stop-the-world Stopping Latencies (GC)" ,
644658 Type : "heatmap" ,
645659 UpdateFreq : 5 ,
646660 Colorscale : PinkShades ,
@@ -659,38 +673,44 @@ func stoppingPausesOtherLayout(samples []metrics.Sample) Heatmap {
659673 TickText : []float64 {1e-7 , 1e-6 , 1e-5 , 1e-4 , 1e-3 , 5e-3 , 1e-2 , 5e-2 , 1e-1 , 5e-1 , 1 , 5 , 10 },
660674 },
661675 },
662- InfoText : `This heatmap shows the distribution of individual non-GC-related stop-the-world stopping latencies. This is the time it takes from deciding to stop the world until all Ps are stopped. This is a subset of the total non-GC-related stop-the-world time. During this time, some threads may be executing. Uses <b>/sched/pauses/stopping/other:seconds</b>.` ,
676+ InfoText : `This heatmap shows the distribution of individual <b>GC-related</b> stop-the-world <i>stopping latencies</i>.
677+ This is the time it takes from deciding to stop the world until all Ps are stopped.
678+ During this time, some threads may be executing.
679+ Uses <b>/sched/pauses/stopping/gc:seconds</b>.` ,
663680 }
664681}
665682
666- func totalPausesOtherLayout (samples []metrics.Sample ) Heatmap {
667- idxtotalother := metricIdx ["/sched/pauses/total /other:seconds" ]
683+ func otherStoppingPausesLayout (samples []metrics.Sample ) Heatmap {
684+ idxstoppingother := metricIdx ["/sched/pauses/stopping /other:seconds" ]
668685
669- totalother := samples [idxtotalother ].Value .Float64Histogram ()
670- histfactor := downsampleFactor (len (totalother .Buckets ), maxBuckets )
671- buckets := downsampleBuckets (totalother , histfactor )
686+ stoppingother := samples [idxstoppingother ].Value .Float64Histogram ()
687+ histfactor := downsampleFactor (len (stoppingother .Buckets ), maxBuckets )
688+ buckets := downsampleBuckets (stoppingother , histfactor )
672689
673690 return Heatmap {
674691 Name : "TODO(set later)" ,
675- Title : "Stop-the-world Pause Latencies (Other)" ,
692+ Title : "Stop-the-world Stopping Latencies (Other)" ,
676693 Type : "heatmap" ,
677694 UpdateFreq : 5 ,
678695 Colorscale : PinkShades ,
679696 Buckets : floatseq (len (buckets )),
680697 CustomData : buckets ,
681698 Hover : HeapmapHover {
682- YName : "pause duration" ,
699+ YName : "stopping duration" ,
683700 YUnit : "duration" ,
684701 ZName : "pauses" ,
685702 },
686703 Layout : HeatmapLayout {
687704 YAxis : HeatmapYaxis {
688- Title : "pause duration" ,
705+ Title : "stopping duration" ,
689706 TickMode : "array" ,
690707 TickVals : []float64 {6 , 13 , 20 , 26 , 33 , 39.5 , 46 , 53 , 60 , 66 , 73 , 79 , 86 },
691708 TickText : []float64 {1e-7 , 1e-6 , 1e-5 , 1e-4 , 1e-3 , 5e-3 , 1e-2 , 5e-2 , 1e-1 , 5e-1 , 1 , 5 , 10 },
692709 },
693710 },
694- InfoText : `This heatmap shows the distribution of individual non-GC-related stop-the-world pause latencies. This is the time from deciding to stop the world until the world is started again. Some of this time is spent getting all threads to stop. Uses <b>/sched/pauses/total/other:seconds</b>.` ,
711+ InfoText : `This heatmap shows the distribution of individual <b>non-GC-related</b> stop-the-world <i>stopping latencies</i>.
712+ This is the time it takes from deciding to stop the world until all Ps are stopped.
713+ This is a subset of the total non-GC-related stop-the-world time. During this time, some threads may be executing.
714+ Uses <b>/sched/pauses/stopping/other:seconds</b>.` ,
695715 }
696716}
0 commit comments