Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ReportMetric (0.1 sec)

  1. src/testing/benchmark_test.go

    				buf.Reset()
    				templ.Execute(&buf, "World")
    			}
    		})
    	})
    }
    
    func TestReportMetric(t *testing.T) {
    	res := testing.Benchmark(func(b *testing.B) {
    		b.ReportMetric(12345, "ns/op")
    		b.ReportMetric(0.2, "frobs/op")
    	})
    	// Test built-in overriding.
    	if res.NsPerOp() != 12345 {
    		t.Errorf("NsPerOp: expected %v, actual %v", 12345, res.NsPerOp())
    	}
    	// Test stringing.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  2. src/sync/pool_test.go

    	slices.Sort(pauses)
    	var total uint64
    	for _, ns := range pauses {
    		total += ns
    	}
    	// ns/op for this benchmark is average STW time.
    	b.ReportMetric(float64(total)/float64(b.N), "ns/op")
    	b.ReportMetric(float64(pauses[len(pauses)*95/100]), "p95-ns/STW")
    	b.ReportMetric(float64(pauses[len(pauses)*50/100]), "p50-ns/STW")
    }
    
    func BenchmarkPoolExpensiveNew(b *testing.B) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8K bytes
    - Viewed (0)
Back to top