Skip to content

Commit d158705

Browse files
Merge pull request #401 from googlemaps/qps
Increase default QPS from 10 to 50
2 parents 112d9d4 + 158faa6 commit d158705

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ For even more information, see the guide to [API keys][apikey].
8484
You can add the library to your project via Maven or Gradle.
8585

8686
**Note:** Since 0.1.18 there is now a dependency on [SLF4J](https://www.slf4j.org/). You need to add
87-
one of the adapter dependencies that makes sense for your logging setup. In the configuration
88-
samples below we are integrating
87+
one of the adapter dependencies that makes sense for your logging setup. In the configuration
88+
samples below we are integrating
8989
[slf4j-nop](https://search.maven.org/#artifactdetails%7Corg.slf4j%7Cslf4j-nop%7C1.7.25%7Cjar),
9090
but there are others like
9191
[slf4j-log4j12](https://search.maven.org/#artifactdetails%7Corg.slf4j%7Cslf4j-log4j12%7C1.7.25%7Cjar)
@@ -197,7 +197,7 @@ based strategy.
197197
### Rate Limiting
198198

199199
Never sleep between requests again! By default, requests are sent at the expected rate limits for
200-
each web service, typically 10 queries per second for free users. If you want to speed up or slow
200+
each web service, typically 50 queries per second for free users. If you want to speed up or slow
201201
down requests, you can do that too, using `new GeoApiContext.Builder().queryRateLimit(qps).build()`.
202202
Note that you still need to manually handle the [delay between the initial request and successive pages](https://developers.google.com/places/web-service/search#PlaceSearchPaging) when you're paging through multiple result sets.
203203

src/main/java/com/google/maps/GeoApiContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public Builder disableRetries() {
451451

452452
/**
453453
* Sets the maximum number of queries that will be executed during a 1 second interval. The
454-
* default is 10. A minimum interval between requests will also be enforced, set to 1/(2 *
454+
* default is 50. A minimum interval between requests will also be enforced, set to 1/(2 *
455455
* {@code maxQps}).
456456
*
457457
* @param maxQps The maximum queries per second.

src/main/java/com/google/maps/internal/RateLimitExecutorService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class RateLimitExecutorService implements ExecutorService, Runnable {
3737

3838
private static final Logger LOG =
3939
LoggerFactory.getLogger(RateLimitExecutorService.class.getName());
40-
private static final int DEFAULT_QUERIES_PER_SECOND = 10;
40+
private static final int DEFAULT_QUERIES_PER_SECOND = 50;
4141

4242
// It's important we set Ok's second arg to threadFactory(.., true) to ensure the threads are
4343
// killed when the app exits. For synchronous requests this is ideal but it means any async

0 commit comments

Comments
 (0)