Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::storage_backend_factory Class Reference

Factory for creating storage backends. More...

#include <storage_backends.h>

Collaboration diagram for kcenon::monitoring::storage_backend_factory:
Collaboration graph

Static Public Member Functions

static std::unique_ptr< snapshot_storage_backendcreate_backend (const storage_config &config)
 Create a storage backend based on configuration.
 
static std::vector< storage_backend_typeget_supported_backends ()
 Get list of supported backend types.
 

Detailed Description

Factory for creating storage backends.

Definition at line 435 of file storage_backends.h.

Member Function Documentation

◆ create_backend()

static std::unique_ptr< snapshot_storage_backend > kcenon::monitoring::storage_backend_factory::create_backend ( const storage_config & config)
inlinestatic

Create a storage backend based on configuration.

Parameters
configStorage configuration
Returns
Unique pointer to storage backend, nullptr on failure

Definition at line 442 of file storage_backends.h.

442 {
443 switch (config.type) {
445 return std::make_unique<memory_storage_backend>(config);
446
450 return std::make_unique<file_storage_backend>(config);
451
455 return std::make_unique<database_storage_backend>(config);
456
460 return std::make_unique<cloud_storage_backend>(config);
461
462 default:
463 return nullptr;
464 }
465 }

References kcenon::monitoring::cloud_azure_blob, kcenon::monitoring::cloud_gcs, kcenon::monitoring::cloud_s3, kcenon::monitoring::database_mysql, kcenon::monitoring::database_postgresql, kcenon::monitoring::database_sqlite, kcenon::monitoring::file_binary, kcenon::monitoring::file_csv, kcenon::monitoring::file_json, kcenon::monitoring::memory_buffer, and kcenon::monitoring::storage_config::type.

Referenced by kcenon::monitoring::create_cloud_storage(), kcenon::monitoring::create_database_storage(), kcenon::monitoring::create_file_storage(), and TEST_F().

Here is the caller graph for this function:

◆ get_supported_backends()


The documentation for this class was generated from the following file: