152 InstanceStatisticsNonatomic() =
default;
154 template <
typename Statistics>
155 InstanceStatisticsNonatomic(
const Statistics& stats) {
162 const InstanceStatistics& stats,
163 const decltype(InstanceStatistics::topology)& topology_stats
165 connection.open_total = stats.connection.open_total;
166 connection.drop_total = stats.connection.drop_total;
167 connection.active = stats.connection.active;
168 connection.used = stats.connection.used;
169 connection.maximum = stats.connection.maximum;
170 connection.waiting = stats.connection.waiting;
171 connection.error_total = stats.connection.error_total;
172 connection.error_timeout = stats.connection.error_timeout;
173 connection.rate_limit_throttled = stats.connection.rate_limit_throttled;
175 connection.max_queue_size = stats.connection.max_queue_size;
177 transaction.total = stats.transaction.total;
178 transaction.commit_total = stats.transaction.commit_total;
179 transaction.rollback_total = stats.transaction.rollback_total;
180 transaction.out_of_trx_total = stats.transaction.out_of_trx_total;
181 transaction.parse_total = stats.transaction.parse_total;
182 transaction.execute_total = stats.transaction.execute_total;
183 transaction.reply_total = stats.transaction.reply_total;
184 transaction.portal_bind_total = stats.transaction.portal_bind_total;
185 transaction.error_execute_total = stats.transaction.error_execute_total;
186 transaction.execute_timeout = stats.transaction.execute_timeout;
187 transaction.duplicate_prepared_statements = stats.transaction.duplicate_prepared_statements;
190 transaction.wait_start_percentile = stats.transaction.wait_start_percentile
.GetStatsForPeriod();
192 transaction.return_to_pool_percentile = stats.transaction.return_to_pool_percentile
.GetStatsForPeriod();
197 pool_exhaust_errors = stats.pool_exhaust_errors;
198 queue_size_errors = stats.queue_size_errors;
206 for (
const auto& [statement_name, statement_stats] : stats) {
207 const auto [it, inserted] = per_statement_stats.try_emplace(statement_name, statement_stats);
209 it->second.Add(statement_stats);
216 std::unordered_map<std::string, StatementStatistics> per_statement_stats;