mcp-wordpress 1.2.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -181
- package/dist/cache/CacheInvalidation.d.ts +3 -3
- package/dist/cache/CacheInvalidation.d.ts.map +1 -1
- package/dist/cache/CacheInvalidation.js +119 -119
- package/dist/cache/CacheInvalidation.js.map +1 -1
- package/dist/cache/CacheManager.d.ts +5 -0
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.js +26 -16
- package/dist/cache/CacheManager.js.map +1 -1
- package/dist/cache/HttpCacheWrapper.d.ts +1 -1
- package/dist/cache/HttpCacheWrapper.d.ts.map +1 -1
- package/dist/cache/HttpCacheWrapper.js +29 -29
- package/dist/cache/HttpCacheWrapper.js.map +1 -1
- package/dist/cache/__tests__/CacheInvalidation.test.js +96 -94
- package/dist/cache/__tests__/CacheInvalidation.test.js.map +1 -1
- package/dist/cache/__tests__/CacheManager.test.js +113 -113
- package/dist/cache/__tests__/CacheManager.test.js.map +1 -1
- package/dist/cache/__tests__/CachedWordPressClient.test.js +102 -99
- package/dist/cache/__tests__/CachedWordPressClient.test.js.map +1 -1
- package/dist/cache/__tests__/HttpCacheWrapper.test.js +98 -95
- package/dist/cache/__tests__/HttpCacheWrapper.test.js.map +1 -1
- package/dist/cache/index.d.ts +7 -7
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +4 -4
- package/dist/cache/index.js.map +1 -1
- package/dist/client/CachedWordPressClient.d.ts +4 -4
- package/dist/client/CachedWordPressClient.d.ts.map +1 -1
- package/dist/client/CachedWordPressClient.js +55 -51
- package/dist/client/CachedWordPressClient.js.map +1 -1
- package/dist/client/api.d.ts +10 -10
- package/dist/client/api.js +158 -158
- package/dist/client/api.js.map +1 -1
- package/dist/client/auth.d.ts +2 -2
- package/dist/client/auth.js +72 -72
- package/dist/client/managers/AuthenticationManager.d.ts +2 -2
- package/dist/client/managers/AuthenticationManager.js +46 -46
- package/dist/client/managers/BaseManager.d.ts +1 -1
- package/dist/client/managers/BaseManager.js +9 -9
- package/dist/client/managers/RequestManager.d.ts +5 -3
- package/dist/client/managers/RequestManager.d.ts.map +1 -1
- package/dist/client/managers/RequestManager.js +39 -19
- package/dist/client/managers/RequestManager.js.map +1 -1
- package/dist/client/managers/index.d.ts +3 -3
- package/dist/client/managers/index.js +3 -3
- package/dist/config/ConfigurationSchema.d.ts +2 -2
- package/dist/config/ConfigurationSchema.d.ts.map +1 -1
- package/dist/config/ConfigurationSchema.js +40 -40
- package/dist/config/ConfigurationSchema.js.map +1 -1
- package/dist/config/ServerConfiguration.d.ts +2 -2
- package/dist/config/ServerConfiguration.js +35 -35
- package/dist/config/ServerConfiguration.js.map +1 -1
- package/dist/docs/DocumentationGenerator.d.ts.map +1 -1
- package/dist/docs/DocumentationGenerator.js +296 -255
- package/dist/docs/DocumentationGenerator.js.map +1 -1
- package/dist/docs/MarkdownFormatter.d.ts +1 -1
- package/dist/docs/MarkdownFormatter.d.ts.map +1 -1
- package/dist/docs/MarkdownFormatter.js +60 -51
- package/dist/docs/MarkdownFormatter.js.map +1 -1
- package/dist/docs/index.d.ts +3 -3
- package/dist/docs/index.d.ts.map +1 -1
- package/dist/docs/index.js +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/mcp-wordpress-1.3.0.tgz +0 -0
- package/dist/performance/MetricsCollector.d.ts +3 -3
- package/dist/performance/MetricsCollector.d.ts.map +1 -1
- package/dist/performance/MetricsCollector.js +33 -27
- package/dist/performance/MetricsCollector.js.map +1 -1
- package/dist/performance/PerformanceAnalytics.d.ts +12 -12
- package/dist/performance/PerformanceAnalytics.d.ts.map +1 -1
- package/dist/performance/PerformanceAnalytics.js +200 -154
- package/dist/performance/PerformanceAnalytics.js.map +1 -1
- package/dist/performance/PerformanceMonitor.d.ts +5 -5
- package/dist/performance/PerformanceMonitor.d.ts.map +1 -1
- package/dist/performance/PerformanceMonitor.js +53 -52
- package/dist/performance/PerformanceMonitor.js.map +1 -1
- package/dist/performance/index.d.ts +6 -6
- package/dist/performance/index.d.ts.map +1 -1
- package/dist/performance/index.js +3 -3
- package/dist/security/InputValidator.d.ts +1 -1
- package/dist/security/InputValidator.d.ts.map +1 -1
- package/dist/security/InputValidator.js +111 -88
- package/dist/security/InputValidator.js.map +1 -1
- package/dist/security/SecurityConfig.d.ts +5 -5
- package/dist/security/SecurityConfig.js +92 -92
- package/dist/security/SecurityConfig.js.map +1 -1
- package/dist/server/ConnectionTester.d.ts +1 -1
- package/dist/server/ConnectionTester.d.ts.map +1 -1
- package/dist/server/ConnectionTester.js +4 -4
- package/dist/server/ConnectionTester.js.map +1 -1
- package/dist/server/ToolRegistry.d.ts +2 -2
- package/dist/server/ToolRegistry.d.ts.map +1 -1
- package/dist/server/ToolRegistry.js +35 -32
- package/dist/server/ToolRegistry.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/tools/BaseToolManager.js +5 -5
- package/dist/tools/auth.d.ts +2 -2
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +32 -31
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/cache.d.ts +1 -1
- package/dist/tools/cache.d.ts.map +1 -1
- package/dist/tools/cache.js +71 -71
- package/dist/tools/cache.js.map +1 -1
- package/dist/tools/comments.d.ts +2 -2
- package/dist/tools/comments.d.ts.map +1 -1
- package/dist/tools/comments.js +79 -79
- package/dist/tools/comments.js.map +1 -1
- package/dist/tools/index.d.ts +10 -10
- package/dist/tools/index.js +10 -10
- package/dist/tools/media.d.ts +2 -2
- package/dist/tools/media.js +80 -80
- package/dist/tools/pages.d.ts +2 -2
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +75 -75
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/performance.d.ts +1 -1
- package/dist/tools/performance.d.ts.map +1 -1
- package/dist/tools/performance.js +311 -287
- package/dist/tools/performance.js.map +1 -1
- package/dist/tools/posts.d.ts +2 -2
- package/dist/tools/posts.d.ts.map +1 -1
- package/dist/tools/posts.js +94 -94
- package/dist/tools/posts.js.map +1 -1
- package/dist/tools/site.d.ts +2 -2
- package/dist/tools/site.d.ts.map +1 -1
- package/dist/tools/site.js +60 -60
- package/dist/tools/site.js.map +1 -1
- package/dist/tools/taxonomies.d.ts +2 -2
- package/dist/tools/taxonomies.js +89 -89
- package/dist/tools/users.d.ts +2 -2
- package/dist/tools/users.js +68 -68
- package/dist/tools/users.js.map +1 -1
- package/dist/types/client.d.ts +13 -13
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/client.js +12 -12
- package/dist/types/client.js.map +1 -1
- package/dist/types/index.d.ts +19 -19
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -3
- package/dist/types/mcp.d.ts +7 -7
- package/dist/types/wordpress.d.ts +21 -21
- package/dist/types/wordpress.d.ts.map +1 -1
- package/dist/utils/debug.d.ts +2 -2
- package/dist/utils/debug.js +28 -28
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/utils/error.js +13 -13
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/toolWrapper.d.ts.map +1 -1
- package/dist/utils/toolWrapper.js +5 -5
- package/dist/utils/toolWrapper.js.map +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +41 -31
- package/dist/utils/validation.js.map +1 -1
- package/docs/CACHING.md +36 -2
- package/docs/DOCKER.md +11 -5
- package/docs/PERFORMANCE_MONITORING.md +49 -1
- package/docs/SECURITY_TESTING.md +30 -1
- package/docs/api/README.md +9 -1
- package/docs/api/summary.json +1 -1
- package/docs/contract-testing.md +24 -3
- package/docs/developer/GITHUB_ACTIONS_SETUP.md +8 -2
- package/docs/developer/MAINTENANCE.md +27 -1
- package/docs/developer/MIGRATION_GUIDE.md +13 -1
- package/docs/developer/NPM_AUTH_SETUP.md +13 -2
- package/docs/developer/REFACTORING.md +31 -1
- package/docs/releases/COMMUNITY_ANNOUNCEMENT_v1.1.2.md +18 -7
- package/docs/releases/RELEASE_NOTES_v1.1.2.md +31 -5
- package/docs/user-guides/DOCKER_SETUP.md +264 -0
- package/docs/user-guides/DTX_SETUP.md +327 -0
- package/docs/user-guides/NPM_SETUP.md +109 -0
- package/docs/user-guides/NPX_SETUP.md +281 -0
- package/docs/wordpress-rest-api-authentication-troubleshooting.md +13 -2
- package/package.json +20 -6
- package/src/cache/CacheInvalidation.ts +140 -132
- package/src/cache/CacheManager.ts +40 -29
- package/src/cache/HttpCacheWrapper.ts +105 -68
- package/src/cache/__tests__/CacheInvalidation.test.ts +123 -118
- package/src/cache/__tests__/CacheManager.test.ts +156 -152
- package/src/cache/__tests__/CachedWordPressClient.test.ts +131 -116
- package/src/cache/__tests__/HttpCacheWrapper.test.ts +118 -115
- package/src/cache/index.ts +13 -13
- package/src/client/CachedWordPressClient.ts +90 -80
- package/src/client/api.ts +205 -205
- package/src/client/auth.ts +80 -80
- package/src/client/managers/AuthenticationManager.ts +61 -61
- package/src/client/managers/BaseManager.ts +11 -11
- package/src/client/managers/RequestManager.ts +79 -47
- package/src/client/managers/index.ts +3 -3
- package/src/config/ConfigurationSchema.ts +44 -44
- package/src/config/ServerConfiguration.ts +39 -39
- package/src/docs/DocumentationGenerator.ts +402 -295
- package/src/docs/MarkdownFormatter.ts +94 -69
- package/src/docs/index.ts +4 -4
- package/src/index.ts +24 -21
- package/src/performance/MetricsCollector.ts +90 -58
- package/src/performance/PerformanceAnalytics.ts +386 -262
- package/src/performance/PerformanceMonitor.ts +152 -118
- package/src/performance/index.ts +9 -9
- package/src/security/InputValidator.ts +148 -91
- package/src/security/SecurityConfig.ts +94 -94
- package/src/server/ConnectionTester.ts +21 -15
- package/src/server/ToolRegistry.ts +64 -51
- package/src/server.ts +2 -2
- package/src/tools/BaseToolManager.ts +6 -6
- package/src/tools/auth.ts +42 -37
- package/src/tools/cache.ts +85 -81
- package/src/tools/comments.ts +93 -91
- package/src/tools/index.ts +10 -10
- package/src/tools/media.ts +89 -89
- package/src/tools/pages.ts +89 -87
- package/src/tools/performance.ts +443 -352
- package/src/tools/posts.ts +109 -107
- package/src/tools/site.ts +86 -77
- package/src/tools/taxonomies.ts +102 -102
- package/src/tools/users.ts +77 -77
- package/src/types/client.ts +157 -60
- package/src/types/index.ts +49 -27
- package/src/types/mcp.ts +15 -15
- package/src/types/wordpress.ts +57 -29
- package/src/utils/debug.ts +37 -37
- package/src/utils/error.ts +47 -25
- package/src/utils/toolWrapper.ts +12 -8
- package/src/utils/validation.ts +116 -65
- package/dist/client/WordPressClient.d.ts +0 -81
- package/dist/client/WordPressClient.d.ts.map +0 -1
- package/dist/client/WordPressClient.js +0 -354
- package/dist/client/WordPressClient.js.map +0 -1
- package/dist/performance/AnomalyDetector.d.ts +0 -63
- package/dist/performance/AnomalyDetector.d.ts.map +0 -1
- package/dist/performance/AnomalyDetector.js +0 -222
- package/dist/performance/AnomalyDetector.js.map +0 -1
- package/dist/performance/BenchmarkAnalyzer.d.ts +0 -67
- package/dist/performance/BenchmarkAnalyzer.d.ts.map +0 -1
- package/dist/performance/BenchmarkAnalyzer.js +0 -301
- package/dist/performance/BenchmarkAnalyzer.js.map +0 -1
- package/dist/performance/TrendAnalyzer.d.ts +0 -69
- package/dist/performance/TrendAnalyzer.d.ts.map +0 -1
- package/dist/performance/TrendAnalyzer.js +0 -203
- package/dist/performance/TrendAnalyzer.js.map +0 -1
- package/dist/tools/BaseToolClass.d.ts +0 -76
- package/dist/tools/BaseToolClass.d.ts.map +0 -1
- package/dist/tools/BaseToolClass.js +0 -104
- package/dist/tools/BaseToolClass.js.map +0 -1
- package/dist/tools/base.d.ts +0 -37
- package/dist/tools/base.d.ts.map +0 -1
- package/dist/tools/base.js +0 -60
- package/dist/tools/base.js.map +0 -1
- package/docs/user-guides/CLAUDE_DESKTOP_SETUP.md +0 -187
|
@@ -18,29 +18,29 @@ export class PerformanceAnalytics {
|
|
|
18
18
|
good: 500, // 200-500ms
|
|
19
19
|
average: 1000, // 500ms-1s
|
|
20
20
|
below_average: 2000, // 1-2s
|
|
21
|
-
poor: Infinity // >2s
|
|
21
|
+
poor: Infinity, // >2s
|
|
22
22
|
},
|
|
23
23
|
cacheHitRate: {
|
|
24
24
|
excellent: 0.95, // >95%
|
|
25
25
|
good: 0.85, // 85-95%
|
|
26
|
-
average: 0.
|
|
27
|
-
below_average: 0.
|
|
28
|
-
poor: 0 // <50%
|
|
26
|
+
average: 0.7, // 70-85%
|
|
27
|
+
below_average: 0.5, // 50-70%
|
|
28
|
+
poor: 0, // <50%
|
|
29
29
|
},
|
|
30
30
|
errorRate: {
|
|
31
31
|
excellent: 0.001, // <0.1%
|
|
32
32
|
good: 0.01, // 0.1-1%
|
|
33
33
|
average: 0.02, // 1-2%
|
|
34
34
|
below_average: 0.05, // 2-5%
|
|
35
|
-
poor: Infinity // >5%
|
|
35
|
+
poor: Infinity, // >5%
|
|
36
36
|
},
|
|
37
37
|
memoryUsage: {
|
|
38
38
|
excellent: 50, // <50%
|
|
39
39
|
good: 70, // 50-70%
|
|
40
40
|
average: 80, // 70-80%
|
|
41
41
|
below_average: 90, // 80-90%
|
|
42
|
-
poor: 100 // >90%
|
|
43
|
-
}
|
|
42
|
+
poor: 100, // >90%
|
|
43
|
+
},
|
|
44
44
|
};
|
|
45
45
|
constructor(collector, config = {}) {
|
|
46
46
|
this.collector = collector;
|
|
@@ -49,8 +49,8 @@ export class PerformanceAnalytics {
|
|
|
49
49
|
enableAnomalyDetection: true,
|
|
50
50
|
enableTrendAnalysis: true,
|
|
51
51
|
lookbackPeriod: 24 * 60 * 60 * 1000, // 24 hours
|
|
52
|
-
sensitivityLevel:
|
|
53
|
-
...config
|
|
52
|
+
sensitivityLevel: "medium",
|
|
53
|
+
...config,
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -60,7 +60,7 @@ export class PerformanceAnalytics {
|
|
|
60
60
|
this.historicalData.push(metrics);
|
|
61
61
|
// Limit historical data to lookback period
|
|
62
62
|
const cutoff = Date.now() - this.config.lookbackPeriod;
|
|
63
|
-
this.historicalData = this.historicalData.filter(data => data.system.uptime > cutoff);
|
|
63
|
+
this.historicalData = this.historicalData.filter((data) => data.system.uptime > cutoff);
|
|
64
64
|
// Run analysis on new data
|
|
65
65
|
if (this.config.enableAnomalyDetection) {
|
|
66
66
|
this.detectAnomalies(metrics);
|
|
@@ -75,15 +75,15 @@ export class PerformanceAnalytics {
|
|
|
75
75
|
}
|
|
76
76
|
const trends = [];
|
|
77
77
|
// Analyze response time trend
|
|
78
|
-
trends.push(this.analyzeTrend(
|
|
78
|
+
trends.push(this.analyzeTrend("responseTime", this.historicalData.map((d) => d.requests.averageResponseTime)));
|
|
79
79
|
// Analyze cache hit rate trend
|
|
80
|
-
trends.push(this.analyzeTrend(
|
|
80
|
+
trends.push(this.analyzeTrend("cacheHitRate", this.historicalData.map((d) => d.cache.hitRate)));
|
|
81
81
|
// Analyze error rate trend
|
|
82
|
-
trends.push(this.analyzeTrend(
|
|
82
|
+
trends.push(this.analyzeTrend("errorRate", this.historicalData.map((d) => d.requests.total > 0 ? d.requests.failed / d.requests.total : 0)));
|
|
83
83
|
// Analyze memory usage trend
|
|
84
|
-
trends.push(this.analyzeTrend(
|
|
84
|
+
trends.push(this.analyzeTrend("memoryUsage", this.historicalData.map((d) => d.system.memoryUsage)));
|
|
85
85
|
// Analyze request volume trend
|
|
86
|
-
trends.push(this.analyzeTrend(
|
|
86
|
+
trends.push(this.analyzeTrend("requestVolume", this.historicalData.map((d) => d.requests.requestsPerSecond)));
|
|
87
87
|
return trends;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
@@ -96,46 +96,46 @@ export class PerformanceAnalytics {
|
|
|
96
96
|
// Cache optimization insights
|
|
97
97
|
if (currentMetrics.cache.hitRate < 0.8) {
|
|
98
98
|
insights.push({
|
|
99
|
-
id:
|
|
100
|
-
category:
|
|
101
|
-
priority:
|
|
102
|
-
title:
|
|
99
|
+
id: "cache-optimization-1",
|
|
100
|
+
category: "optimization",
|
|
101
|
+
priority: "high",
|
|
102
|
+
title: "Improve Cache Hit Rate",
|
|
103
103
|
description: `Current cache hit rate is ${(currentMetrics.cache.hitRate * 100).toFixed(1)}%, which is below optimal performance.`,
|
|
104
|
-
impact:
|
|
105
|
-
recommendation:
|
|
106
|
-
estimatedImprovement:
|
|
107
|
-
implementationEffort:
|
|
108
|
-
relatedMetrics: [
|
|
104
|
+
impact: "performance",
|
|
105
|
+
recommendation: "Implement cache warming strategies and optimize TTL values for frequently accessed data.",
|
|
106
|
+
estimatedImprovement: "20-40% reduction in response times",
|
|
107
|
+
implementationEffort: "medium",
|
|
108
|
+
relatedMetrics: ["cacheHitRate", "responseTime"],
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
// Response time insights
|
|
112
112
|
if (currentMetrics.requests.averageResponseTime > 1000) {
|
|
113
113
|
insights.push({
|
|
114
|
-
id:
|
|
115
|
-
category:
|
|
116
|
-
priority:
|
|
117
|
-
title:
|
|
114
|
+
id: "response-time-1",
|
|
115
|
+
category: "optimization",
|
|
116
|
+
priority: "high",
|
|
117
|
+
title: "Reduce Response Times",
|
|
118
118
|
description: `Average response time of ${currentMetrics.requests.averageResponseTime.toFixed(0)}ms is above recommended threshold.`,
|
|
119
|
-
impact:
|
|
120
|
-
recommendation:
|
|
121
|
-
estimatedImprovement:
|
|
122
|
-
implementationEffort:
|
|
123
|
-
relatedMetrics: [
|
|
119
|
+
impact: "user_experience",
|
|
120
|
+
recommendation: "Enable aggressive caching, optimize database queries, or consider upgrading server resources.",
|
|
121
|
+
estimatedImprovement: "50-70% reduction in response times",
|
|
122
|
+
implementationEffort: "medium",
|
|
123
|
+
relatedMetrics: ["responseTime", "cacheHitRate"],
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
// Memory usage insights
|
|
127
127
|
if (currentMetrics.system.memoryUsage > 80) {
|
|
128
128
|
insights.push({
|
|
129
|
-
id:
|
|
130
|
-
category:
|
|
131
|
-
priority:
|
|
132
|
-
title:
|
|
129
|
+
id: "memory-usage-1",
|
|
130
|
+
category: "scaling",
|
|
131
|
+
priority: "medium",
|
|
132
|
+
title: "Memory Usage Optimization",
|
|
133
133
|
description: `Memory usage at ${currentMetrics.system.memoryUsage}% is approaching limits.`,
|
|
134
|
-
impact:
|
|
135
|
-
recommendation:
|
|
136
|
-
estimatedImprovement:
|
|
137
|
-
implementationEffort:
|
|
138
|
-
relatedMetrics: [
|
|
134
|
+
impact: "reliability",
|
|
135
|
+
recommendation: "Increase cache size limits, implement cache eviction policies, or scale server resources.",
|
|
136
|
+
estimatedImprovement: "Improved system stability",
|
|
137
|
+
implementationEffort: "low",
|
|
138
|
+
relatedMetrics: ["memoryUsage", "cacheSize"],
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
// Tool usage insights
|
|
@@ -145,32 +145,34 @@ export class PerformanceAnalytics {
|
|
|
145
145
|
.sort(([, a], [, b]) => b - a)
|
|
146
146
|
.slice(0, 3);
|
|
147
147
|
insights.push({
|
|
148
|
-
id:
|
|
149
|
-
category:
|
|
150
|
-
priority:
|
|
151
|
-
title:
|
|
152
|
-
description: `Most used tools: ${mostUsed.map(([tool]) => tool).join(
|
|
153
|
-
impact:
|
|
154
|
-
recommendation:
|
|
155
|
-
estimatedImprovement:
|
|
156
|
-
implementationEffort:
|
|
157
|
-
relatedMetrics: [
|
|
148
|
+
id: "tool-usage-1",
|
|
149
|
+
category: "optimization",
|
|
150
|
+
priority: "low",
|
|
151
|
+
title: "Optimize Frequently Used Tools",
|
|
152
|
+
description: `Most used tools: ${mostUsed.map(([tool]) => tool).join(", ")}. Consider optimizing these workflows.`,
|
|
153
|
+
impact: "performance",
|
|
154
|
+
recommendation: "Create cached workflows or batch operations for frequently used tools.",
|
|
155
|
+
estimatedImprovement: "10-20% reduction in API calls",
|
|
156
|
+
implementationEffort: "high",
|
|
157
|
+
relatedMetrics: ["toolUsage", "requestVolume"],
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
// Trend-based insights
|
|
161
|
-
const responseTimeTrend = trends.find(t => t.metric ===
|
|
162
|
-
if (responseTimeTrend &&
|
|
161
|
+
const responseTimeTrend = trends.find((t) => t.metric === "responseTime");
|
|
162
|
+
if (responseTimeTrend &&
|
|
163
|
+
responseTimeTrend.direction === "declining" &&
|
|
164
|
+
responseTimeTrend.changeRate > 10) {
|
|
163
165
|
insights.push({
|
|
164
|
-
id:
|
|
165
|
-
category:
|
|
166
|
-
priority:
|
|
167
|
-
title:
|
|
166
|
+
id: "trend-response-time-1",
|
|
167
|
+
category: "alert",
|
|
168
|
+
priority: "high",
|
|
169
|
+
title: "Response Time Degradation Detected",
|
|
168
170
|
description: `Response times are declining at ${responseTimeTrend.changeRate.toFixed(1)}% rate.`,
|
|
169
|
-
impact:
|
|
170
|
-
recommendation:
|
|
171
|
-
estimatedImprovement:
|
|
172
|
-
implementationEffort:
|
|
173
|
-
relatedMetrics: [
|
|
171
|
+
impact: "performance",
|
|
172
|
+
recommendation: "Investigate recent changes, check WordPress site health, and monitor resource usage.",
|
|
173
|
+
estimatedImprovement: "Prevent further degradation",
|
|
174
|
+
implementationEffort: "medium",
|
|
175
|
+
relatedMetrics: ["responseTime", "errorRate"],
|
|
174
176
|
});
|
|
175
177
|
}
|
|
176
178
|
this.generatedInsights = insights;
|
|
@@ -183,20 +185,22 @@ export class PerformanceAnalytics {
|
|
|
183
185
|
const currentMetrics = this.collector.collectCurrentMetrics();
|
|
184
186
|
const comparisons = [];
|
|
185
187
|
// Response time benchmark
|
|
186
|
-
comparisons.push(this.createBenchmarkComparison(
|
|
187
|
-
));
|
|
188
|
+
comparisons.push(this.createBenchmarkComparison("Response Time", currentMetrics.requests.averageResponseTime, this.benchmarks.responseTime, false));
|
|
188
189
|
// Cache hit rate benchmark
|
|
189
|
-
comparisons.push(this.createBenchmarkComparison(
|
|
190
|
-
|
|
190
|
+
comparisons.push(this.createBenchmarkComparison("Cache Hit Rate", currentMetrics.cache.hitRate * 100, Object.fromEntries(Object.entries(this.benchmarks.cacheHitRate).map(([k, v]) => [
|
|
191
|
+
k,
|
|
192
|
+
v * 100,
|
|
193
|
+
])), true));
|
|
191
194
|
// Error rate benchmark
|
|
192
195
|
const errorRate = currentMetrics.requests.total > 0
|
|
193
196
|
? (currentMetrics.requests.failed / currentMetrics.requests.total) * 100
|
|
194
197
|
: 0;
|
|
195
|
-
comparisons.push(this.createBenchmarkComparison(
|
|
196
|
-
|
|
198
|
+
comparisons.push(this.createBenchmarkComparison("Error Rate", errorRate, Object.fromEntries(Object.entries(this.benchmarks.errorRate).map(([k, v]) => [
|
|
199
|
+
k,
|
|
200
|
+
v * 100,
|
|
201
|
+
])), false));
|
|
197
202
|
// Memory usage benchmark
|
|
198
|
-
comparisons.push(this.createBenchmarkComparison(
|
|
199
|
-
));
|
|
203
|
+
comparisons.push(this.createBenchmarkComparison("Memory Usage", currentMetrics.system.memoryUsage, this.benchmarks.memoryUsage, false));
|
|
200
204
|
return comparisons;
|
|
201
205
|
}
|
|
202
206
|
/**
|
|
@@ -217,16 +221,22 @@ export class PerformanceAnalytics {
|
|
|
217
221
|
currentValue: this.getCurrentMetricValue(trend.metric),
|
|
218
222
|
predictedValue,
|
|
219
223
|
confidence: trend.confidence,
|
|
220
|
-
trend: trend.direction
|
|
224
|
+
trend: trend.direction,
|
|
221
225
|
});
|
|
222
226
|
// Generate alerts for concerning predictions
|
|
223
|
-
if (trend.metric ===
|
|
227
|
+
if (trend.metric === "responseTime" &&
|
|
228
|
+
predictedValue > 2000 &&
|
|
229
|
+
trend.direction === "declining") {
|
|
224
230
|
alerts.push(`Response times predicted to exceed 2s in ${timeframeMinutes} minutes`);
|
|
225
231
|
}
|
|
226
|
-
if (trend.metric ===
|
|
232
|
+
if (trend.metric === "cacheHitRate" &&
|
|
233
|
+
predictedValue < 0.5 &&
|
|
234
|
+
trend.direction === "declining") {
|
|
227
235
|
alerts.push(`Cache hit rate predicted to drop below 50% in ${timeframeMinutes} minutes`);
|
|
228
236
|
}
|
|
229
|
-
if (trend.metric ===
|
|
237
|
+
if (trend.metric === "memoryUsage" &&
|
|
238
|
+
predictedValue > 90 &&
|
|
239
|
+
trend.direction === "declining") {
|
|
230
240
|
alerts.push(`Memory usage predicted to exceed 90% in ${timeframeMinutes} minutes`);
|
|
231
241
|
}
|
|
232
242
|
}
|
|
@@ -237,9 +247,10 @@ export class PerformanceAnalytics {
|
|
|
237
247
|
*/
|
|
238
248
|
generateOptimizationPlan() {
|
|
239
249
|
const insights = this.generateInsights();
|
|
240
|
-
const quickWins = insights.filter(i => i.implementationEffort ===
|
|
241
|
-
|
|
242
|
-
const
|
|
250
|
+
const quickWins = insights.filter((i) => i.implementationEffort === "low" &&
|
|
251
|
+
["high", "critical"].includes(i.priority));
|
|
252
|
+
const mediumTerm = insights.filter((i) => i.implementationEffort === "medium");
|
|
253
|
+
const longTerm = insights.filter((i) => i.implementationEffort === "high");
|
|
243
254
|
// Estimate ROI based on current performance issues
|
|
244
255
|
const currentMetrics = this.collector.collectCurrentMetrics();
|
|
245
256
|
let estimatedGain = 0;
|
|
@@ -255,9 +266,13 @@ export class PerformanceAnalytics {
|
|
|
255
266
|
longTerm,
|
|
256
267
|
estimatedROI: {
|
|
257
268
|
performanceGain: Math.min(estimatedGain, 80), // Cap at 80%
|
|
258
|
-
implementationCost: quickWins.length > 2
|
|
259
|
-
|
|
260
|
-
|
|
269
|
+
implementationCost: quickWins.length > 2
|
|
270
|
+
? "low"
|
|
271
|
+
: mediumTerm.length > 2
|
|
272
|
+
? "medium"
|
|
273
|
+
: "high",
|
|
274
|
+
timeToValue: quickWins.length > 0 ? 1 : mediumTerm.length > 0 ? 7 : 30,
|
|
275
|
+
},
|
|
261
276
|
};
|
|
262
277
|
}
|
|
263
278
|
/**
|
|
@@ -265,7 +280,7 @@ export class PerformanceAnalytics {
|
|
|
265
280
|
*/
|
|
266
281
|
getAnomalies(severity) {
|
|
267
282
|
if (severity) {
|
|
268
|
-
return this.detectedAnomalies.filter(a => a.severity === severity);
|
|
283
|
+
return this.detectedAnomalies.filter((a) => a.severity === severity);
|
|
269
284
|
}
|
|
270
285
|
return [...this.detectedAnomalies];
|
|
271
286
|
}
|
|
@@ -280,15 +295,15 @@ export class PerformanceAnalytics {
|
|
|
280
295
|
summary: {
|
|
281
296
|
overallHealth: this.calculateOverallHealth(performanceScore),
|
|
282
297
|
keyInsights: this.generatedInsights.length,
|
|
283
|
-
criticalAlerts: this.generatedInsights.filter(i => i.priority ===
|
|
284
|
-
performanceScore
|
|
298
|
+
criticalAlerts: this.generatedInsights.filter((i) => i.priority === "critical").length,
|
|
299
|
+
performanceScore,
|
|
285
300
|
},
|
|
286
301
|
trends: this.analyzeTrends(),
|
|
287
302
|
benchmarks: this.benchmarkPerformance(),
|
|
288
303
|
insights: this.generateInsights(),
|
|
289
304
|
anomalies: this.getAnomalies(),
|
|
290
305
|
predictions: this.predictPerformance(),
|
|
291
|
-
optimizationPlan: this.generateOptimizationPlan()
|
|
306
|
+
optimizationPlan: this.generateOptimizationPlan(),
|
|
292
307
|
};
|
|
293
308
|
}
|
|
294
309
|
/**
|
|
@@ -298,10 +313,14 @@ export class PerformanceAnalytics {
|
|
|
298
313
|
if (values.length < 3) {
|
|
299
314
|
return {
|
|
300
315
|
metric: metricName,
|
|
301
|
-
direction:
|
|
316
|
+
direction: "stable",
|
|
302
317
|
changeRate: 0,
|
|
303
318
|
confidence: 0,
|
|
304
|
-
prediction: {
|
|
319
|
+
prediction: {
|
|
320
|
+
nextValue: values[values.length - 1] || 0,
|
|
321
|
+
timeframe: 0,
|
|
322
|
+
confidence: 0,
|
|
323
|
+
},
|
|
305
324
|
};
|
|
306
325
|
}
|
|
307
326
|
// Calculate linear regression
|
|
@@ -311,30 +330,34 @@ export class PerformanceAnalytics {
|
|
|
311
330
|
const sumX = x.reduce((a, b) => a + b, 0);
|
|
312
331
|
const sumY = y.reduce((a, b) => a + b, 0);
|
|
313
332
|
const sumXY = x.map((xi, i) => xi * y[i]).reduce((a, b) => a + b, 0);
|
|
314
|
-
const sumXX = x.map(xi => xi * xi).reduce((a, b) => a + b, 0);
|
|
333
|
+
const sumXX = x.map((xi) => xi * xi).reduce((a, b) => a + b, 0);
|
|
315
334
|
const slope = (n * sumXY - sumX * sumY) / (n * sumXX - sumX * sumX);
|
|
316
335
|
const intercept = (sumY - slope * sumX) / n;
|
|
317
336
|
// Calculate R-squared for confidence
|
|
318
337
|
const yMean = sumY / n;
|
|
319
|
-
const totalSumSquares = y
|
|
320
|
-
|
|
338
|
+
const totalSumSquares = y
|
|
339
|
+
.map((yi) => Math.pow(yi - yMean, 2))
|
|
340
|
+
.reduce((a, b) => a + b, 0);
|
|
341
|
+
const residualSumSquares = y
|
|
342
|
+
.map((yi, i) => {
|
|
321
343
|
const predicted = slope * x[i] + intercept;
|
|
322
344
|
return Math.pow(yi - predicted, 2);
|
|
323
|
-
})
|
|
324
|
-
|
|
345
|
+
})
|
|
346
|
+
.reduce((a, b) => a + b, 0);
|
|
347
|
+
const rSquared = 1 - residualSumSquares / totalSumSquares;
|
|
325
348
|
// Determine direction and change rate
|
|
326
349
|
const currentValue = values[values.length - 1];
|
|
327
350
|
const previousValue = values[values.length - 2];
|
|
328
351
|
const changeRate = Math.abs((currentValue - previousValue) / previousValue) * 100;
|
|
329
|
-
let direction =
|
|
352
|
+
let direction = "stable";
|
|
330
353
|
if (Math.abs(slope) > 0.1) {
|
|
331
354
|
// For metrics where lower is better (response time, error rate)
|
|
332
|
-
if ([
|
|
333
|
-
direction = slope < 0 ?
|
|
355
|
+
if (["responseTime", "errorRate", "memoryUsage"].includes(metricName)) {
|
|
356
|
+
direction = slope < 0 ? "improving" : "declining";
|
|
334
357
|
}
|
|
335
358
|
else {
|
|
336
359
|
// For metrics where higher is better (cache hit rate)
|
|
337
|
-
direction = slope > 0 ?
|
|
360
|
+
direction = slope > 0 ? "improving" : "declining";
|
|
338
361
|
}
|
|
339
362
|
}
|
|
340
363
|
// Predict next value
|
|
@@ -347,8 +370,8 @@ export class PerformanceAnalytics {
|
|
|
347
370
|
prediction: {
|
|
348
371
|
nextValue: Math.max(0, nextValue),
|
|
349
372
|
timeframe: 30 * 60 * 1000, // 30 minutes
|
|
350
|
-
confidence: Math.max(0, Math.min(1, rSquared * 0.8)) // Slightly lower confidence for predictions
|
|
351
|
-
}
|
|
373
|
+
confidence: Math.max(0, Math.min(1, rSquared * 0.8)), // Slightly lower confidence for predictions
|
|
374
|
+
},
|
|
352
375
|
};
|
|
353
376
|
}
|
|
354
377
|
/**
|
|
@@ -359,17 +382,17 @@ export class PerformanceAnalytics {
|
|
|
359
382
|
return; // Need historical context
|
|
360
383
|
const recentData = this.historicalData.slice(-10);
|
|
361
384
|
// Check response time anomalies
|
|
362
|
-
const responseTimes = recentData.map(d => d.requests.averageResponseTime);
|
|
363
|
-
this.checkMetricAnomaly(
|
|
385
|
+
const responseTimes = recentData.map((d) => d.requests.averageResponseTime);
|
|
386
|
+
this.checkMetricAnomaly("responseTime", metrics.requests.averageResponseTime, responseTimes, "Response time spike detected");
|
|
364
387
|
// Check cache hit rate anomalies
|
|
365
|
-
const hitRates = recentData.map(d => d.cache.hitRate);
|
|
366
|
-
this.checkMetricAnomaly(
|
|
388
|
+
const hitRates = recentData.map((d) => d.cache.hitRate);
|
|
389
|
+
this.checkMetricAnomaly("cacheHitRate", metrics.cache.hitRate, hitRates, "Cache hit rate drop detected");
|
|
367
390
|
// Check error rate anomalies
|
|
368
|
-
const errorRates = recentData.map(d => d.requests.total > 0 ? d.requests.failed / d.requests.total : 0);
|
|
391
|
+
const errorRates = recentData.map((d) => d.requests.total > 0 ? d.requests.failed / d.requests.total : 0);
|
|
369
392
|
const currentErrorRate = metrics.requests.total > 0
|
|
370
393
|
? metrics.requests.failed / metrics.requests.total
|
|
371
394
|
: 0;
|
|
372
|
-
this.checkMetricAnomaly(
|
|
395
|
+
this.checkMetricAnomaly("errorRate", currentErrorRate, errorRates, "Error rate spike detected");
|
|
373
396
|
}
|
|
374
397
|
/**
|
|
375
398
|
* Check if a metric value is anomalous
|
|
@@ -378,25 +401,26 @@ export class PerformanceAnalytics {
|
|
|
378
401
|
if (historicalValues.length < 5)
|
|
379
402
|
return;
|
|
380
403
|
const mean = historicalValues.reduce((a, b) => a + b, 0) / historicalValues.length;
|
|
381
|
-
const variance = historicalValues.reduce((acc, val) => acc + Math.pow(val - mean, 2), 0) /
|
|
404
|
+
const variance = historicalValues.reduce((acc, val) => acc + Math.pow(val - mean, 2), 0) /
|
|
405
|
+
historicalValues.length;
|
|
382
406
|
const standardDeviation = Math.sqrt(variance);
|
|
383
407
|
// Calculate z-score
|
|
384
408
|
const zScore = Math.abs((currentValue - mean) / standardDeviation);
|
|
385
409
|
// Determine sensitivity threshold
|
|
386
410
|
let threshold = 2; // Default for medium sensitivity
|
|
387
|
-
if (this.config.sensitivityLevel ===
|
|
411
|
+
if (this.config.sensitivityLevel === "low")
|
|
388
412
|
threshold = 3;
|
|
389
|
-
if (this.config.sensitivityLevel ===
|
|
413
|
+
if (this.config.sensitivityLevel === "high")
|
|
390
414
|
threshold = 1.5;
|
|
391
415
|
if (zScore > threshold) {
|
|
392
416
|
const deviation = ((currentValue - mean) / mean) * 100;
|
|
393
|
-
let severity =
|
|
417
|
+
let severity = "minor";
|
|
394
418
|
if (zScore > 4)
|
|
395
|
-
severity =
|
|
419
|
+
severity = "critical";
|
|
396
420
|
else if (zScore > 3)
|
|
397
|
-
severity =
|
|
421
|
+
severity = "major";
|
|
398
422
|
else if (zScore > 2.5)
|
|
399
|
-
severity =
|
|
423
|
+
severity = "moderate";
|
|
400
424
|
const anomaly = {
|
|
401
425
|
timestamp: Date.now(),
|
|
402
426
|
metric: metricName,
|
|
@@ -404,7 +428,7 @@ export class PerformanceAnalytics {
|
|
|
404
428
|
actualValue: currentValue,
|
|
405
429
|
deviation,
|
|
406
430
|
severity,
|
|
407
|
-
possibleCauses: this.generatePossibleCauses(metricName, currentValue > mean)
|
|
431
|
+
possibleCauses: this.generatePossibleCauses(metricName, currentValue > mean),
|
|
408
432
|
};
|
|
409
433
|
this.detectedAnomalies.push(anomaly);
|
|
410
434
|
// Limit anomaly history
|
|
@@ -418,14 +442,14 @@ export class PerformanceAnalytics {
|
|
|
418
442
|
*/
|
|
419
443
|
generatePossibleCauses(metricName, isIncrease) {
|
|
420
444
|
const causes = [];
|
|
421
|
-
if (metricName ===
|
|
422
|
-
causes.push(
|
|
445
|
+
if (metricName === "responseTime" && isIncrease) {
|
|
446
|
+
causes.push("High server load", "Database performance issues", "Network latency", "Cache miss increase");
|
|
423
447
|
}
|
|
424
|
-
else if (metricName ===
|
|
425
|
-
causes.push(
|
|
448
|
+
else if (metricName === "cacheHitRate" && !isIncrease) {
|
|
449
|
+
causes.push("Cache invalidation event", "New data requests", "Cache size limit reached", "TTL expiration");
|
|
426
450
|
}
|
|
427
|
-
else if (metricName ===
|
|
428
|
-
causes.push(
|
|
451
|
+
else if (metricName === "errorRate" && isIncrease) {
|
|
452
|
+
causes.push("WordPress site issues", "Authentication problems", "Network connectivity", "Plugin conflicts");
|
|
429
453
|
}
|
|
430
454
|
return causes;
|
|
431
455
|
}
|
|
@@ -433,57 +457,69 @@ export class PerformanceAnalytics {
|
|
|
433
457
|
* Create benchmark comparison
|
|
434
458
|
*/
|
|
435
459
|
createBenchmarkComparison(category, currentValue, benchmarks, higherIsBetter) {
|
|
436
|
-
let status =
|
|
460
|
+
let status = "poor";
|
|
437
461
|
let percentile = 0;
|
|
438
462
|
let improvement = 0;
|
|
439
463
|
if (higherIsBetter) {
|
|
440
464
|
if (currentValue >= benchmarks.excellent)
|
|
441
|
-
status =
|
|
465
|
+
status = "excellent";
|
|
442
466
|
else if (currentValue >= benchmarks.good)
|
|
443
|
-
status =
|
|
467
|
+
status = "good";
|
|
444
468
|
else if (currentValue >= benchmarks.average)
|
|
445
|
-
status =
|
|
469
|
+
status = "average";
|
|
446
470
|
else if (currentValue >= benchmarks.below_average)
|
|
447
|
-
status =
|
|
471
|
+
status = "below_average";
|
|
448
472
|
// Calculate improvement needed
|
|
449
|
-
if (status !==
|
|
450
|
-
const nextTier = status ===
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
473
|
+
if (status !== "excellent") {
|
|
474
|
+
const nextTier = status === "good"
|
|
475
|
+
? benchmarks.excellent
|
|
476
|
+
: status === "average"
|
|
477
|
+
? benchmarks.good
|
|
478
|
+
: status === "below_average"
|
|
479
|
+
? benchmarks.average
|
|
480
|
+
: benchmarks.below_average;
|
|
454
481
|
improvement = nextTier - currentValue;
|
|
455
482
|
}
|
|
456
483
|
}
|
|
457
484
|
else {
|
|
458
485
|
if (currentValue <= benchmarks.excellent)
|
|
459
|
-
status =
|
|
486
|
+
status = "excellent";
|
|
460
487
|
else if (currentValue <= benchmarks.good)
|
|
461
|
-
status =
|
|
488
|
+
status = "good";
|
|
462
489
|
else if (currentValue <= benchmarks.average)
|
|
463
|
-
status =
|
|
490
|
+
status = "average";
|
|
464
491
|
else if (currentValue <= benchmarks.below_average)
|
|
465
|
-
status =
|
|
492
|
+
status = "below_average";
|
|
466
493
|
// Calculate improvement needed
|
|
467
|
-
if (status !==
|
|
468
|
-
const nextTier = status ===
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
494
|
+
if (status !== "excellent") {
|
|
495
|
+
const nextTier = status === "good"
|
|
496
|
+
? benchmarks.excellent
|
|
497
|
+
: status === "average"
|
|
498
|
+
? benchmarks.good
|
|
499
|
+
: status === "below_average"
|
|
500
|
+
? benchmarks.average
|
|
501
|
+
: benchmarks.below_average;
|
|
472
502
|
improvement = currentValue - nextTier;
|
|
473
503
|
}
|
|
474
504
|
}
|
|
475
505
|
// Calculate percentile (simplified)
|
|
476
|
-
percentile =
|
|
477
|
-
status ===
|
|
478
|
-
|
|
479
|
-
|
|
506
|
+
percentile =
|
|
507
|
+
status === "excellent"
|
|
508
|
+
? 95
|
|
509
|
+
: status === "good"
|
|
510
|
+
? 80
|
|
511
|
+
: status === "average"
|
|
512
|
+
? 60
|
|
513
|
+
: status === "below_average"
|
|
514
|
+
? 30
|
|
515
|
+
: 10;
|
|
480
516
|
return {
|
|
481
517
|
category,
|
|
482
518
|
currentValue,
|
|
483
519
|
benchmarkValue: benchmarks.excellent,
|
|
484
520
|
percentile,
|
|
485
521
|
status,
|
|
486
|
-
improvement
|
|
522
|
+
improvement,
|
|
487
523
|
};
|
|
488
524
|
}
|
|
489
525
|
/**
|
|
@@ -492,12 +528,20 @@ export class PerformanceAnalytics {
|
|
|
492
528
|
getCurrentMetricValue(metricName) {
|
|
493
529
|
const current = this.collector.collectCurrentMetrics();
|
|
494
530
|
switch (metricName) {
|
|
495
|
-
case
|
|
496
|
-
|
|
497
|
-
case
|
|
498
|
-
|
|
499
|
-
case
|
|
500
|
-
|
|
531
|
+
case "responseTime":
|
|
532
|
+
return current.requests.averageResponseTime;
|
|
533
|
+
case "cacheHitRate":
|
|
534
|
+
return current.cache.hitRate;
|
|
535
|
+
case "errorRate":
|
|
536
|
+
return current.requests.total > 0
|
|
537
|
+
? current.requests.failed / current.requests.total
|
|
538
|
+
: 0;
|
|
539
|
+
case "memoryUsage":
|
|
540
|
+
return current.system.memoryUsage;
|
|
541
|
+
case "requestVolume":
|
|
542
|
+
return current.requests.requestsPerSecond;
|
|
543
|
+
default:
|
|
544
|
+
return 0;
|
|
501
545
|
}
|
|
502
546
|
}
|
|
503
547
|
/**
|
|
@@ -513,7 +557,9 @@ export class PerformanceAnalytics {
|
|
|
513
557
|
else if (metrics.requests.averageResponseTime > 500)
|
|
514
558
|
score -= 5;
|
|
515
559
|
// Error rate (25% weight)
|
|
516
|
-
const errorRate = metrics.requests.total > 0
|
|
560
|
+
const errorRate = metrics.requests.total > 0
|
|
561
|
+
? metrics.requests.failed / metrics.requests.total
|
|
562
|
+
: 0;
|
|
517
563
|
if (errorRate > 0.05)
|
|
518
564
|
score -= 25;
|
|
519
565
|
else if (errorRate > 0.02)
|
|
@@ -541,14 +587,14 @@ export class PerformanceAnalytics {
|
|
|
541
587
|
*/
|
|
542
588
|
calculateOverallHealth(score) {
|
|
543
589
|
if (score >= 90)
|
|
544
|
-
return
|
|
590
|
+
return "excellent";
|
|
545
591
|
if (score >= 75)
|
|
546
|
-
return
|
|
592
|
+
return "good";
|
|
547
593
|
if (score >= 60)
|
|
548
|
-
return
|
|
594
|
+
return "fair";
|
|
549
595
|
if (score >= 40)
|
|
550
|
-
return
|
|
551
|
-
return
|
|
596
|
+
return "poor";
|
|
597
|
+
return "critical";
|
|
552
598
|
}
|
|
553
599
|
}
|
|
554
600
|
//# sourceMappingURL=PerformanceAnalytics.js.map
|