commonpower.benchmark.storage.BenchmarkStorageFactory
- class BenchmarkStorageFactory[source]
Bases:
objectFactory class for creating benchmark storage objects based on the storage type. Currently supports two storage types: “file” and “mongo”.
- Usage:
factory = BenchmarkStorageFactory() storage = factory.get_storage(“file”)
Methods
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.