Description
Map<String, BlobStoreActionStats> stats()
is an interface to get stats from the blob store for every repository implementation (S3, Azure, GCS). The problem with this API that it returns different keys depending on the environment. Specifically every cloud implementation checks if it's serverless:
S3:
@Override
public Map<String, BlobStoreActionStats> stats() {
return statsCollectors.statsMap(service.isStateless);
}
Azure:
@Override
public Map<String, BlobStoreActionStats> stats() {
return requestMetricsRecorder.statsMap(service.isStateless());
}
GCS:
@Override
public Map<String, BlobStoreActionStats> stats() {
return statsCollector.operationsStats(storageService.isServerless());
}
And outcome of API will be different. In stateful Map<Operation, BlobStoreActionStats>
and serverless Map<OperationPurpose_Operation, BlobStoreActionStats>
. So serverless returns two dimensional data, every pair of purpose and operation. Caller of this API needs to know how to deal with different outputs.
We need to change API so it accepts arguments that describe what kind of stats caller needs. For example, which dimensions OperationPurpose, Operation, or maybe both stats(List<Dimensions>)
or more rigid stats(boolean withOperationPurpose)
. Also remove serverless flag.