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 55 of file pool_config.hpp.

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.
 
PoolSettings pool_settings {}
 settings for connections pool
 
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 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 56 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 88 of file pool_config.hpp.

◆ cc_config

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

Congestion control config.

Definition at line 99 of file pool_config.hpp.

◆ conn_timeout

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

Connection (I/O) timeout.

Definition at line 75 of file pool_config.hpp.

◆ driver_impl

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

Driver implementation to use.

Definition at line 93 of file pool_config.hpp.

◆ kDefaultAppName

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

Default application name.

Definition at line 69 of file pool_config.hpp.

◆ kDefaultConnTimeout

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

Default connection timeout.

Definition at line 61 of file pool_config.hpp.

◆ kDefaultMaintenancePeriod

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

Default pool maintenance period.

Definition at line 67 of file pool_config.hpp.

◆ kDefaultQueueTimeout

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

Default connection queue timeout.

Definition at line 65 of file pool_config.hpp.

◆ kDefaultSoTimeout

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

Default socket timeout.

Definition at line 63 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 83 of file pool_config.hpp.

◆ maintenance_period

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

Pool maintenance period.

Definition at line 85 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 90 of file pool_config.hpp.

◆ pool_settings

PoolSettings storages::mongo::PoolConfig::pool_settings {}

settings for connections pool

Definition at line 81 of file pool_config.hpp.

◆ queue_timeout

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

Connection queue wait time.

Definition at line 79 of file pool_config.hpp.

◆ so_timeout

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

Socket (I/O) timeout.

Definition at line 77 of file pool_config.hpp.

◆ stats_verbosity

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

Whether to write detailed stats.

Definition at line 96 of file pool_config.hpp.


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