mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-09 10:57:03 +08:00
perf(gateway): scale request hot paths for 20k streams
Shard and singleflight hot-path caches, batch and prioritize candidate and usage lifecycle persistence, and extend database and pressure-test instrumentation for 20k concurrent streams.
This commit is contained in:
@@ -17,10 +17,10 @@ use super::{
|
||||
OAuthProviderWriteRepository, PoolMemberScoreWriteRepository, PoolScoreReadRepository,
|
||||
ProviderCatalogReadRepository, ProviderCatalogWriteRepository, ProviderQuotaReadRepository,
|
||||
ProviderQuotaWriteRepository, ProxyNodeReadRepository, ProxyNodeWriteRepository,
|
||||
RequestCandidateReadRepository, RequestCandidateWriteRepository, SettlementWriteRepository,
|
||||
StoredSystemConfigEntry, StoredUserPreferenceRecord, UsageReadRepository, UsageWriteRepository,
|
||||
UserReadRepository, VideoTaskReadRepository, VideoTaskWriteRepository, WalletReadRepository,
|
||||
WalletWriteRepository,
|
||||
RequestCandidateReadRepository, RequestCandidateWriteRepository, RoutingGroupReadRepository,
|
||||
RoutingGroupWriteRepository, SettlementWriteRepository, StoredSystemConfigEntry,
|
||||
StoredUserPreferenceRecord, UsageReadRepository, UsageWriteRepository, UserReadRepository,
|
||||
VideoTaskReadRepository, VideoTaskWriteRepository, WalletReadRepository, WalletWriteRepository,
|
||||
};
|
||||
|
||||
mod announcements;
|
||||
@@ -867,6 +867,16 @@ impl GatewayDataState {
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn with_routing_group_repository_for_tests<T>(mut self, repository: Arc<T>) -> Self
|
||||
where
|
||||
T: RoutingGroupReadRepository + RoutingGroupWriteRepository + 'static,
|
||||
{
|
||||
self.routing_group_reader = Some(repository.clone());
|
||||
self.routing_group_writer = Some(repository);
|
||||
self
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn with_auth_api_key_reader(
|
||||
mut self,
|
||||
|
||||
Reference in New Issue
Block a user