feat(ops): 优化健康评分算法和智能诊断机制
- 采用分层加权评分(业务70% + 基础设施30%),避免重复扣分 - 新增延迟诊断(P99 > 2s critical, > 1s warning) - 新增资源诊断(CPU/内存/DB/Redis状态) - 调整诊断阈值(上游错误率5% critical,请求错误率3% critical) - 为每个诊断项添加可操作建议 - 添加完整的单元测试覆盖(30+测试用例) - 完善中英文国际化文本
This commit is contained in:
@@ -1928,22 +1928,62 @@ export default {
|
||||
footer: 'Automated diagnostic suggestions based on current metrics',
|
||||
idle: 'System is currently idle',
|
||||
idleImpact: 'No active traffic',
|
||||
// Resource diagnostics
|
||||
dbDown: 'Database connection failed',
|
||||
dbDownImpact: 'All database operations will fail',
|
||||
dbDownAction: 'Check database service status, network connectivity, and connection configuration',
|
||||
redisDown: 'Redis connection failed',
|
||||
redisDownImpact: 'Cache functionality degraded, performance may decline',
|
||||
redisDownAction: 'Check Redis service status and network connectivity',
|
||||
cpuCritical: 'CPU usage critically high ({usage}%)',
|
||||
cpuCriticalImpact: 'System response slowing, may affect all requests',
|
||||
cpuCriticalAction: 'Check CPU-intensive tasks, consider scaling or code optimization',
|
||||
cpuHigh: 'CPU usage elevated ({usage}%)',
|
||||
cpuHighImpact: 'System load is high, needs attention',
|
||||
cpuHighAction: 'Monitor CPU trends, prepare scaling plan',
|
||||
memoryCritical: 'Memory usage critically high ({usage}%)',
|
||||
memoryCriticalImpact: 'May trigger OOM, system stability threatened',
|
||||
memoryCriticalAction: 'Check for memory leaks, consider increasing memory or optimizing usage',
|
||||
memoryHigh: 'Memory usage elevated ({usage}%)',
|
||||
memoryHighImpact: 'Memory pressure is high, needs attention',
|
||||
memoryHighAction: 'Monitor memory trends, check for memory leaks',
|
||||
// Latency diagnostics
|
||||
latencyCritical: 'Response latency critically high ({latency}ms)',
|
||||
latencyCriticalImpact: 'User experience extremely poor, many requests timing out',
|
||||
latencyCriticalAction: 'Check slow queries, database indexes, network latency, and upstream services',
|
||||
latencyHigh: 'Response latency elevated ({latency}ms)',
|
||||
latencyHighImpact: 'User experience degraded, needs optimization',
|
||||
latencyHighAction: 'Analyze slow request logs, optimize database queries and business logic',
|
||||
ttftHigh: 'Time to first byte elevated ({ttft}ms)',
|
||||
ttftHighImpact: 'User perceived latency increased',
|
||||
ttftHighAction: 'Optimize request processing flow, reduce pre-processing time',
|
||||
// Error rate diagnostics
|
||||
upstreamCritical: 'Upstream error rate critically high ({rate}%)',
|
||||
upstreamCriticalImpact: 'May affect many user requests',
|
||||
upstreamCriticalAction: 'Check upstream service health, enable fallback strategies',
|
||||
upstreamHigh: 'Upstream error rate elevated ({rate}%)',
|
||||
upstreamHighImpact: 'Recommend checking upstream service status',
|
||||
slaCritical: 'SLA critically below target ({sla}%)',
|
||||
slaCriticalImpact: 'User experience severely degraded',
|
||||
slaLow: 'SLA below target ({sla}%)',
|
||||
slaLowImpact: 'Service quality needs attention',
|
||||
upstreamHighAction: 'Contact upstream service team, prepare fallback plan',
|
||||
errorHigh: 'Error rate too high ({rate}%)',
|
||||
errorHighImpact: 'Many requests failing',
|
||||
errorHighAction: 'Check error logs, identify root cause, urgent fix required',
|
||||
errorElevated: 'Error rate elevated ({rate}%)',
|
||||
errorElevatedImpact: 'Recommend checking error logs',
|
||||
errorElevatedAction: 'Analyze error types and distribution, create fix plan',
|
||||
// SLA diagnostics
|
||||
slaCritical: 'SLA critically below target ({sla}%)',
|
||||
slaCriticalImpact: 'User experience severely degraded',
|
||||
slaCriticalAction: 'Urgently investigate errors and latency, consider rate limiting',
|
||||
slaLow: 'SLA below target ({sla}%)',
|
||||
slaLowImpact: 'Service quality needs attention',
|
||||
slaLowAction: 'Analyze SLA decline causes, optimize system performance',
|
||||
// Health score diagnostics
|
||||
healthCritical: 'Overall health score critically low ({score})',
|
||||
healthCriticalImpact: 'Multiple metrics may be degraded; prioritize error rate and latency investigation',
|
||||
healthCriticalAction: 'Comprehensive system check, prioritize critical-level issues',
|
||||
healthLow: 'Overall health score low ({score})',
|
||||
healthLowImpact: 'May indicate minor instability; monitor SLA and error rates',
|
||||
healthLowAction: 'Monitor metric trends, prevent issue escalation',
|
||||
healthy: 'All system metrics normal',
|
||||
healthyImpact: 'Service running stable'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user