-
Notifications
You must be signed in to change notification settings - Fork 136
test: add a default benchmark for measuring baselines. #2739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add a default benchmark for measuring baselines. #2739
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
| * <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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-paste error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removed.
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this also call executeWarmup, so the number of warmup queries is respected for updates as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, added this.
| * <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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
olavloite
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| * | ||
| * <p>CREATE TABLE FOO ( id INT64 NOT NULL, BAZ INT64, BAR INT64, ) PRIMARY KEY(id); | ||
| * | ||
| * <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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.