commonpower.benchmark.storage.BenchmarkStorageFactory

class BenchmarkStorageFactory[source]

Bases: object

Factory class for creating benchmark storage objects based on the storage type. Currently supports two storage types: “file” and “mongo”.

get_storage()[source]

Returns a benchmark storage object based on the storage type.

Usage:

factory = BenchmarkStorageFactory() storage = factory.get_storage(“file”)

Methods

get_storage

Returns an instance of a storage class based on the given storage type.

static get_storage(storage_type: str)[source]

Returns an instance of a storage class based on the given storage type.

Parameters:

storage_type (str) – The type of storage to use. Valid options are “file” and “mongo”.

Returns:

An instance of a storage class based on the given storage type.

Raises:

ValueError – If an invalid storage type is provided.