1
// Copyright 2010 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.
13
func gcstats(name string, n int, t int64) {
14
st := &runtime.MemStats
15
fmt.Printf("garbage.%sMem Alloc=%d/%d Heap=%d NextGC=%d Mallocs=%d\n", name, st.Alloc, st.TotalAlloc, st.Sys, st.NextGC, st.Mallocs)
16
fmt.Printf("garbage.%s %d %d ns/op\n", name, n, t/int64(n))
17
fmt.Printf("garbage.%sLastPause 1 %d ns/op\n", name, st.PauseNs[(st.NumGC-1)%uint32(len(st.PauseNs))])
18
fmt.Printf("garbage.%sPause %d %d ns/op\n", name, st.NumGC, int64(st.PauseTotalNs)/int64(st.NumGC))
20
if nn >= len(st.PauseNs) {
23
t1, t2, t3, t4, t5 := tukey5(st.PauseNs[0:nn])
24
fmt.Printf("garbage.%sPause5: %d %d %d %d %d\n", name, t1, t2, t3, t4, t5)
26
// fmt.Printf("garbage.%sScan: %v\n", name, st.ScanDist)
30
func (t T) Len() int { return len(t) }
31
func (t T) Swap(i, j int) { t[i], t[j] = t[j], t[i] }
32
func (t T) Less(i, j int) bool { return t[i] < t[j] }
34
func tukey5(raw []uint64) (lo, q1, q2, q3, hi uint64) {
35
x := make(T, len(raw))