test: add a default benchmark for measuring baselines.#2739
test: add a default benchmark for measuring baselines.#2739gcf-merge-on-green[bot] merged 18 commits intogoogleapis:mainfrom
Conversation
…od while retrying exceptions in unit tests. * For details on issue see - googleapis#2206
fix: prevent illegal negative timeout values into thread sleep() method while retrying exceptions in unit tests.
google-cloud-spanner/src/test/java/com/google/cloud/spanner/BenchmarkingDataLoaderUtility.java
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/BenchmarkingDataLoaderUtility.java
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/BenchmarkingDataLoaderUtility.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/BenchmarkingDataLoaderUtility.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/BenchmarkingDataLoaderUtility.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultBenchmark.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultBenchmark.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/DefaultBenchmark.java
Outdated
Show resolved
Hide resolved
google-cloud-spanner/src/test/java/com/google/cloud/spanner/BenchmarkingUtilityTest.java
Outdated
Show resolved
Hide resolved
| public class BenchmarkingUtilityTest { | ||
|
|
||
| @ClassRule | ||
| public static IntegrationTestEnv env = new IntegrationTestEnv(); |
| * <p>Some read requests will be long-running and will cause session leaks. Such sessions will be | ||
| * removed by the session maintenance background task if SessionPool Option | ||
| * ActionOnInactiveTransaction is set as WARN_AND_CLOSE. | ||
| * | ||
| * <p>Some write requests will be long-running. The test asserts that no sessions are removed by | ||
| * the session maintenance background task with SessionPool Option ActionOnInactiveTransaction set | ||
| * as WARN_AND_CLOSE. This is because PDML writes are expected to be long-running. |
| final BenchmarkState server, int numberOfOperations) { | ||
| List<Duration> results = new ArrayList<>(numberOfOperations); | ||
| // Execute one update to make sure everything has been warmed up. | ||
| executeUpdate(server); |
There was a problem hiding this comment.
Shouldn't this also call executeWarmup, so the number of warmup queries is respected for updates as well?
| * <p>Table schema used here: CREATE TABLE FOO ( id INT64 NOT NULL, BAZ INT64, BAR INT64, ) | ||
| * PRIMARY KEY(id); | ||
| */ | ||
| @Test |
There was a problem hiding this comment.
Do we want this as an actual test that is executed during (nightly?) builds? If so, it should verify that the test actually succeeds by adding at least one assertion.
Or would it make more sense to move this method to the actual benchmark class, so it can more easily be executed together with a benchmark?
There was a problem hiding this comment.
I had annotated BenchmarkingUtilityTest with @Category(SlowTest.class). This will make sure its excluded from our pre-submits and nightly tests. Note that the data loading utility is a one time activity and does not need to be executed repeatedly along with the benchmarks. Hence, I think it will be better to leave this as separate standalone class.
- I have now moved the latency reporting utility methods (
printResults,percentile, etc.) to a new classAbstractLatencyBenchmark. Any benchmark that aims to report latencies can extendAbstractLatencyBenchmarkand get this methods. - I am renaming this class to
BenchmarkingUtilityScriptsand it now only has the data loading functionality. AvoidingTestin the class name will ensure it does not qualify for any continuous tests.
…nchmarkingUtilityTest.java Co-authored-by: Knut Olav Løite <koloite@gmail.com>
| @@ -55,17 +54,17 @@ | |||
| * <p>Below are a few considerations here: 1. We use all default options for this test because that | |||
There was a problem hiding this comment.
super-nit (feel free to leave as is): Use <ol> and <li> tags to create an actual ordered (numbered) list.
Uh oh!
There was an error while loading. Please reload this page.