Skip to content

Add parameters to BlobStore#stats() request for different dimensions #126262

Open
@mhl-b

Description

@mhl-b

default Map<String, BlobStoreActionStats> stats() {

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions