]> Cypherpunks repositories - gostls13.git/commit
testing: add an example showcasing B.RunParallel with B.ReportMetric
authorEddie Lopez <ejlopez00@gmail.com>
Fri, 30 Sep 2022 20:51:33 +0000 (16:51 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 7 Oct 2022 17:49:17 +0000 (17:49 +0000)
commitcecaa25bd31622f5ae0df7fd5c8c7f02afde8715
tree8026896dc5862f0193d34901b878ba1fc1c61086
parent747e1961e95c2eb3df62e045b90b111c2ceea337
testing: add an example showcasing B.RunParallel with B.ReportMetric

This commit was dedicated to adding an example of using B.ReportMetrics
with B.RunParallel called ExampleB_ReportMetric_parallel. In this
example, the same algorithm for ExampleB_ReportMetric was used, instead
with a concurrent for loop using PB.Next instead of a standard one.
There is also notes noting when to use the B.ReportMetric methods when
running concurrent testing.

Fixes #50756
Change-Id: I2a621b4e367af5f4ec47d38a0da1035a8d52f628
Reviewed-on: https://go-review.googlesource.com/c/go/+/437815
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/testing/benchmark_test.go