Skip to content

Commit faa0a83

Browse files
committed
Preinitialize Azure metrics for BlobStoreRepositoryTests too
And remove the constructor that depends on lazy initialization.
1 parent 918d80b commit faa0a83

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

modules/repository-azure/src/internalClusterTest/java/org/elasticsearch/repositories/azure/AzureBlobStoreRepositoryTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import java.nio.charset.StandardCharsets;
5050
import java.nio.file.NoSuchFileException;
5151
import java.util.ArrayList;
52+
import java.util.Arrays;
5253
import java.util.Base64;
5354
import java.util.Collection;
5455
import java.util.Collections;
@@ -242,7 +243,7 @@ protected String requestUniqueId(final HttpExchange exchange) {
242243
private static class AzureHTTPStatsCollectorHandler extends HttpStatsCollectorHandler {
243244

244245
private AzureHTTPStatsCollectorHandler(HttpHandler delegate) {
245-
super(delegate);
246+
super(delegate, Arrays.stream(AzureBlobStore.Operation.values()).map(AzureBlobStore.Operation::getKey).toArray(String[]::new));
246247
}
247248

248249
@Override

test/framework/src/main/java/org/elasticsearch/repositories/blobstore/ESMockAPIBasedRepositoryIntegTestCase.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,6 @@ public abstract static class HttpStatsCollectorHandler implements DelegatingHttp
354354

355355
private final Map<String, Long> operationCount = new HashMap<>();
356356

357-
public HttpStatsCollectorHandler(HttpHandler delegate) {
358-
this.delegate = delegate;
359-
}
360-
361357
public HttpStatsCollectorHandler(HttpHandler delegate, String[] operations) {
362358
this.delegate = delegate;
363359
for (String operation : operations) {

0 commit comments

Comments
 (0)