Skip to content

Commit

Permalink
refactor: move metrics creation to constructor
Browse files Browse the repository at this point in the history
No need to keep this as class variable
  • Loading branch information
jeqo committed Oct 13, 2023
1 parent 5459570 commit 4910c4d
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import com.google.cloud.storage.StorageOptions;

public class GcsStorage implements StorageBackend {
private final MetricCollector metricCollector = new MetricCollector();

private Storage storage;
private String bucketName;
private Integer resumableUploadChunkSize;
Expand All @@ -48,7 +46,7 @@ public void configure(final Map<String, ?> configs) {
this.bucketName = config.bucketName();
final StorageOptions.Builder builder = StorageOptions.newBuilder()
.setCredentials(config.credentials())
.setTransportOptions(metricCollector.httpTransportOptions());
.setTransportOptions(new MetricCollector().httpTransportOptions());
if (config.endpointUrl() != null) {
builder.setHost(config.endpointUrl());
}
Expand Down

0 comments on commit 4910c4d

Please sign in to comment.