userver: storages::mongo::PoolConfig Struct Reference
Loading...
Searching...
No Matches
storages::mongo::PoolConfig Struct Referencefinal

#include <userver/storages/mongo/pool_config.hpp>

Detailed Description

MongoDB connection pool configuration.

Definition at line 24 of file pool_config.hpp.

+ Collaboration diagram for storages::mongo::PoolConfig:

Public Types

enum class  DriverImpl { kMongoCDriver }
 

Public Member Functions

void Validate (const std::string &pool_id) const
 

Public Attributes

std::chrono::milliseconds conn_timeout = kDefaultConnTimeout
 Connection (I/O) timeout.
 
std::chrono::milliseconds so_timeout = kDefaultSoTimeout
 Socket (I/O) timeout.
 
std::chrono::milliseconds queue_timeout = kDefaultQueueTimeout
 Connection queue wait time.
 
size_t initial_size = kDefaultInitialSize
 Initial connection count.
 
size_t max_size = kDefaultMaxSize
 Total connections limit.
 
size_t idle_limit = kDefaultIdleLimit
 Idle connections limit.
 
size_t connecting_limit = kDefaultConnectingLimit
 Establishing connections limit.
 
std::optional< std::chrono::milliseconds > local_threshold {}
 Instance selection latency window override.
 
std::chrono::milliseconds maintenance_period = kDefaultMaintenancePeriod
 Pool maintenance period.
 
std::string app_name = kDefaultAppName
 Application name (sent to server)
 
std::optional< std::chrono::seconds > max_replication_lag
 Default max replication lag for the pool.
 
DriverImpl driver_impl = DriverImpl::kMongoCDriver
 Driver implementation to use.
 
StatsVerbosity stats_verbosity = StatsVerbosity::kTerse
 Whether to write detailed stats.
 
congestion_control::v2::LinearController::StaticConfig cc_config
 Congestion control config.
 

Static Public Attributes

static constexpr auto kDefaultConnTimeout = std::chrono::seconds{2}
 Default connection timeout.
 
static constexpr auto kDefaultSoTimeout = std::chrono::seconds{10}
 Default socket timeout.
 
static constexpr auto kDefaultQueueTimeout = std::chrono::seconds{1}
 Default connection queue timeout.
 
static constexpr size_t kDefaultInitialSize = 16
 Default initial connection count.
 
static constexpr size_t kDefaultMaxSize = 128
 Default total connections limit.
 
static constexpr size_t kDefaultIdleLimit = 64
 Default idle connections limit.
 
static constexpr size_t kDefaultConnectingLimit = 8
 Default establishing connections limit.
 
static constexpr auto kDefaultMaintenancePeriod = std::chrono::seconds{15}
 Default pool maintenance period.
 
static constexpr char kDefaultAppName [] = "userver"
 Default application name.
 

Member Enumeration Documentation

◆ DriverImpl

enum class storages::mongo::PoolConfig::DriverImpl
strong

Definition at line 25 of file pool_config.hpp.

Member Function Documentation

◆ Validate()

void storages::mongo::PoolConfig::Validate ( const std::string & pool_id) const
Exceptions
InvalidConfigExceptionif the config is invalid

Member Data Documentation

◆ app_name

std::string storages::mongo::PoolConfig::app_name = kDefaultAppName

Application name (sent to server)

Definition at line 71 of file pool_config.hpp.

◆ cc_config

congestion_control::v2::LinearController::StaticConfig storages::mongo::PoolConfig::cc_config

Congestion control config.

Definition at line 82 of file pool_config.hpp.

◆ conn_timeout

std::chrono::milliseconds storages::mongo::PoolConfig::conn_timeout = kDefaultConnTimeout

Connection (I/O) timeout.

Definition at line 52 of file pool_config.hpp.

◆ connecting_limit

size_t storages::mongo::PoolConfig::connecting_limit = kDefaultConnectingLimit

Establishing connections limit.

Definition at line 64 of file pool_config.hpp.

◆ driver_impl

DriverImpl storages::mongo::PoolConfig::driver_impl = DriverImpl::kMongoCDriver

Driver implementation to use.

Definition at line 76 of file pool_config.hpp.

◆ idle_limit

size_t storages::mongo::PoolConfig::idle_limit = kDefaultIdleLimit

Idle connections limit.

Definition at line 62 of file pool_config.hpp.

◆ initial_size

size_t storages::mongo::PoolConfig::initial_size = kDefaultInitialSize

Initial connection count.

Definition at line 58 of file pool_config.hpp.

◆ kDefaultAppName

constexpr char storages::mongo::PoolConfig::kDefaultAppName[] = "userver"
staticconstexpr

Default application name.

Definition at line 46 of file pool_config.hpp.

◆ kDefaultConnectingLimit

constexpr size_t storages::mongo::PoolConfig::kDefaultConnectingLimit = 8
staticconstexpr

Default establishing connections limit.

Definition at line 42 of file pool_config.hpp.

◆ kDefaultConnTimeout

constexpr auto storages::mongo::PoolConfig::kDefaultConnTimeout = std::chrono::seconds{2}
staticconstexpr

Default connection timeout.

Definition at line 30 of file pool_config.hpp.

◆ kDefaultIdleLimit

constexpr size_t storages::mongo::PoolConfig::kDefaultIdleLimit = 64
staticconstexpr

Default idle connections limit.

Definition at line 40 of file pool_config.hpp.

◆ kDefaultInitialSize

constexpr size_t storages::mongo::PoolConfig::kDefaultInitialSize = 16
staticconstexpr

Default initial connection count.

Definition at line 36 of file pool_config.hpp.

◆ kDefaultMaintenancePeriod

constexpr auto storages::mongo::PoolConfig::kDefaultMaintenancePeriod = std::chrono::seconds{15}
staticconstexpr

Default pool maintenance period.

Definition at line 44 of file pool_config.hpp.

◆ kDefaultMaxSize

constexpr size_t storages::mongo::PoolConfig::kDefaultMaxSize = 128
staticconstexpr

Default total connections limit.

Definition at line 38 of file pool_config.hpp.

◆ kDefaultQueueTimeout

constexpr auto storages::mongo::PoolConfig::kDefaultQueueTimeout = std::chrono::seconds{1}
staticconstexpr

Default connection queue timeout.

Definition at line 34 of file pool_config.hpp.

◆ kDefaultSoTimeout

constexpr auto storages::mongo::PoolConfig::kDefaultSoTimeout = std::chrono::seconds{10}
staticconstexpr

Default socket timeout.

Definition at line 32 of file pool_config.hpp.

◆ local_threshold

std::optional<std::chrono::milliseconds> storages::mongo::PoolConfig::local_threshold {}

Instance selection latency window override.

Definition at line 66 of file pool_config.hpp.

◆ maintenance_period

std::chrono::milliseconds storages::mongo::PoolConfig::maintenance_period = kDefaultMaintenancePeriod

Pool maintenance period.

Definition at line 68 of file pool_config.hpp.

◆ max_replication_lag

std::optional<std::chrono::seconds> storages::mongo::PoolConfig::max_replication_lag

Default max replication lag for the pool.

Definition at line 73 of file pool_config.hpp.

◆ max_size

size_t storages::mongo::PoolConfig::max_size = kDefaultMaxSize

Total connections limit.

Definition at line 60 of file pool_config.hpp.

◆ queue_timeout

std::chrono::milliseconds storages::mongo::PoolConfig::queue_timeout = kDefaultQueueTimeout

Connection queue wait time.

Definition at line 56 of file pool_config.hpp.

◆ so_timeout

std::chrono::milliseconds storages::mongo::PoolConfig::so_timeout = kDefaultSoTimeout

Socket (I/O) timeout.

Definition at line 54 of file pool_config.hpp.

◆ stats_verbosity

StatsVerbosity storages::mongo::PoolConfig::stats_verbosity = StatsVerbosity::kTerse

Whether to write detailed stats.

Definition at line 79 of file pool_config.hpp.


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