Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 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. internal/grid/benchmark_test.go

    					// This will give an estimate of the total ops/s.
    					latency := float64(atomic.LoadInt64(&lat)) / float64(time.Millisecond)
    					b.ReportMetric(float64(n)*float64(ops)/spent.Seconds(), "vops/s")
    					b.ReportMetric(latency/float64(ops), "ms/op")
    				}
    			})
    		}
    	})
    	b.Run("rpc", func(b *testing.B) {
    		for par := 1; par <= 32; par *= 2 {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Jun 07 15:51:52 UTC 2024
    - 15.7K 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/runtime/gc_test.go

    	b.ReportMetric(0, "ns/op")
    	b.ReportMetric(0, "B/op")
    	b.ReportMetric(0, "allocs/op")
    
    	// Sort latencies then report percentiles.
    	slices.Sort(latencies)
    	b.ReportMetric(float64(latencies[len(latencies)*50/100]), "p50-ns")
    	b.ReportMetric(float64(latencies[len(latencies)*90/100]), "p90-ns")
    	b.ReportMetric(float64(latencies[len(latencies)*99/100]), "p99-ns")
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 05 22:33:52 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  5. src/testing/benchmark.go

    	if b.timerOn {
    		d += highPrecisionTimeSince(b.start)
    	}
    	return d
    }
    
    // ReportMetric adds "n unit" to the reported benchmark results.
    // If the metric is per-iteration, the caller should divide by b.N,
    // and by convention units should end in "/op".
    // ReportMetric overrides any previously reported value for the same unit.
    // ReportMetric panics if unit is the empty string or if unit contains
    // any whitespace.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 23.9K bytes
    - Viewed (0)
  6. src/time/sleep_test.go

    	max := Duration(0)
    	for _, s := range stats {
    		if s.max > max {
    			max = s.max
    		}
    		total += s.sum
    		samples += float64(s.count)
    	}
    	b.ReportMetric(0, "ns/op")
    	b.ReportMetric(total/samples, "avg-late-ns")
    	b.ReportMetric(float64(max.Nanoseconds()), "max-late-ns")
    }
    
    // Benchmark timer latency with staggered wakeup times and varying CPU bound
    // workloads. https://golang.org/issue/38860
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:33:57 UTC 2024
    - 22.5K bytes
    - Viewed (0)
  7. src/runtime/runtime_test.go

    			}
    			b.StopTimer()
    
    			// Sort latencies then report percentiles.
    			slices.Sort(latencies)
    			b.ReportMetric(float64(latencies[len(latencies)*50/100]), "p50-ns")
    			b.ReportMetric(float64(latencies[len(latencies)*90/100]), "p90-ns")
    			b.ReportMetric(float64(latencies[len(latencies)*99/100]), "p99-ns")
    		}
    		return func(b *testing.B) {
    			b.Run("idle", runOne)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  8. src/runtime/metrics_test.go

    	b.ReportMetric(0, "ns/op")
    	b.ReportMetric(0, "B/op")
    	b.ReportMetric(0, "allocs/op")
    
    	// Sort latencies then report percentiles.
    	sort.Slice(latencies, func(i, j int) bool {
    		return latencies[i] < latencies[j]
    	})
    	b.ReportMetric(float64(latencies[len(latencies)*50/100]), "p50-ns")
    	b.ReportMetric(float64(latencies[len(latencies)*90/100]), "p90-ns")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:52:17 UTC 2024
    - 45K bytes
    - Viewed (0)
  9. pilot/pkg/xds/bench_test.go

    			// Cannot use b.Logf, it truncates
    			benchmarkScope.Infof("Generated: %d %s", i, s)
    		}
    	}
    	bytes := 0
    	for _, r := range m {
    		bytes += len(r.GetResource().Value)
    	}
    	b.ReportMetric(float64(bytes)/1000, "kb/msg")
    	b.ReportMetric(float64(len(m)), "resources/msg")
    	b.StartTimer()
    }
    
    func createEndpointsConfig(numEndpoints, numServices, numNetworks int) []config.Config {
    	result := make([]config.Config, 0, numServices)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Apr 22 18:13:40 UTC 2024
    - 19.7K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator_test.go

    			// requests for a single entry, so we do both.
    			s.doAuthForTokenN(r.Intn(s.tokenCount), a)
    			s.doAuthForTokenN(0, a)
    		}
    	})
    	b.StopTimer()
    
    	b.ReportMetric(float64(lookups)/float64(b.N), "lookups/op")
    }
    
    // Add a test version of the audit context with a pre-populated event for easy annotation
    // extraction.
    func withAudit(ctx context.Context) context.Context {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 20.3K bytes
    - Viewed (0)
Back to top