You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
2.3 KiB
56 lines
2.3 KiB
export default {
|
|
base: "/",
|
|
|
|
// 路由缓存配置
|
|
routeCache: {
|
|
// 是否启用路由缓存(生产环境建议启用)
|
|
enabled: process.env.NODE_ENV === 'production',
|
|
|
|
// 各类缓存的最大条目数
|
|
maxMatchCacheSize: 1000, // 路由匹配缓存
|
|
maxControllerCacheSize: 100, // 控制器实例缓存
|
|
maxMiddlewareCacheSize: 200, // 中间件组合缓存
|
|
maxRegistrationCacheSize: 50, // 路由注册缓存
|
|
|
|
// 缓存清理配置
|
|
cleanupInterval: 5 * 60 * 1000, // 清理间隔(5分钟)
|
|
|
|
// 性能监控配置
|
|
performance: {
|
|
enabled: process.env.NODE_ENV === 'production',
|
|
windowSize: 100, // 监控窗口大小
|
|
slowRouteThreshold: 500, // 慢路由阈值(毫秒)
|
|
cleanupInterval: 5 * 60 * 1000 // 清理间隔
|
|
}
|
|
},
|
|
|
|
// 路由性能监控配置
|
|
routePerformance: {
|
|
// 是否启用性能监控
|
|
enabled: process.env.NODE_ENV === 'production' || process.env.PERFORMANCE_MONITOR === 'true',
|
|
|
|
// 监控窗口大小(保留最近N次请求的数据)
|
|
windowSize: parseInt(process.env.PERFORMANCE_WINDOW_SIZE) || 100,
|
|
|
|
// 慢路由阈值(毫秒)
|
|
slowRouteThreshold: parseInt(process.env.SLOW_ROUTE_THRESHOLD) || 500,
|
|
|
|
// 自动清理间隔(毫秒)
|
|
cleanupInterval: parseInt(process.env.PERFORMANCE_CLEANUP_INTERVAL) || 5 * 60 * 1000,
|
|
|
|
// 性能数据保留时间(毫秒)
|
|
dataRetentionTime: parseInt(process.env.PERFORMANCE_DATA_RETENTION) || 10 * 60 * 1000,
|
|
|
|
// 最小分析数据量(少于此数量不进行性能分析)
|
|
minAnalysisDataCount: parseInt(process.env.MIN_ANALYSIS_DATA_COUNT) || 10,
|
|
|
|
// 缓存命中率警告阈值(百分比)
|
|
cacheHitRateWarningThreshold: parseFloat(process.env.CACHE_HIT_RATE_WARNING) || 0.5,
|
|
|
|
// 是否启用自动优化建议
|
|
enableOptimizationSuggestions: process.env.ENABLE_OPTIMIZATION_SUGGESTIONS !== 'false',
|
|
|
|
// 性能报告的最大路由数量
|
|
maxRouteReportCount: parseInt(process.env.MAX_ROUTE_REPORT_COUNT) || 50
|
|
}
|
|
}
|
|
|