Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for ReportMetric (0.12 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/cmd/go/init_test.go

    			}
    			atomic.AddInt64(&n, 1)
    			atomic.AddInt64(&userTime, int64(cmd.ProcessState.UserTime()))
    			atomic.AddInt64(&systemTime, int64(cmd.ProcessState.SystemTime()))
    		}
    	})
    	b.ReportMetric(float64(userTime)/float64(n), "user-ns/op")
    	b.ReportMetric(float64(systemTime)/float64(n), "sys-ns/op")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 15 20:21:26 UTC 2022
    - 1.1K bytes
    - Viewed (0)
  3. 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)
  4. src/go/types/self_test.go

    				Scopes:     make(map[ast.Node]*Scope),
    			}
    		}
    		if _, err := conf.Check(path, fset, files, info); err != nil {
    			b.Fatal(err)
    		}
    	}
    	b.StopTimer()
    	b.ReportMetric(float64(lines)*float64(b.N)/time.Since(start).Seconds(), "lines/s")
    }
    
    func pkgFiles(fset *token.FileSet, path string) ([]*ast.File, error) {
    	filenames, err := pkgFilenames(path, true) // from stdlib_test.go
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 19:39:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/self_test.go

    				Scopes:     make(map[syntax.Node]*Scope),
    			}
    		}
    		if _, err := conf.Check(path, files, info); err != nil {
    			b.Fatal(err)
    		}
    	}
    	b.StopTimer()
    	b.ReportMetric(float64(lines)*float64(b.N)/time.Since(start).Seconds(), "lines/s")
    }
    
    func pkgFiles(path string) ([]*syntax.File, error) {
    	filenames, err := pkgFilenames(path, true) // from stdlib_test.go
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 19:39:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
Back to top