crackerjack 0.33.0__py3-none-any.whl → 0.33.2__py3-none-any.whl
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.
Potentially problematic release.
This version of crackerjack might be problematic. Click here for more details.
- crackerjack/__main__.py +1350 -34
- crackerjack/adapters/__init__.py +17 -0
- crackerjack/adapters/lsp_client.py +358 -0
- crackerjack/adapters/rust_tool_adapter.py +194 -0
- crackerjack/adapters/rust_tool_manager.py +193 -0
- crackerjack/adapters/skylos_adapter.py +231 -0
- crackerjack/adapters/zuban_adapter.py +560 -0
- crackerjack/agents/base.py +7 -3
- crackerjack/agents/coordinator.py +271 -33
- crackerjack/agents/documentation_agent.py +9 -15
- crackerjack/agents/dry_agent.py +3 -15
- crackerjack/agents/formatting_agent.py +1 -1
- crackerjack/agents/import_optimization_agent.py +36 -180
- crackerjack/agents/performance_agent.py +17 -98
- crackerjack/agents/performance_helpers.py +7 -31
- crackerjack/agents/proactive_agent.py +1 -3
- crackerjack/agents/refactoring_agent.py +16 -85
- crackerjack/agents/refactoring_helpers.py +7 -42
- crackerjack/agents/security_agent.py +9 -48
- crackerjack/agents/test_creation_agent.py +356 -513
- crackerjack/agents/test_specialist_agent.py +0 -4
- crackerjack/api.py +6 -25
- crackerjack/cli/cache_handlers.py +204 -0
- crackerjack/cli/cache_handlers_enhanced.py +683 -0
- crackerjack/cli/facade.py +100 -0
- crackerjack/cli/handlers.py +224 -9
- crackerjack/cli/interactive.py +6 -4
- crackerjack/cli/options.py +642 -55
- crackerjack/cli/utils.py +2 -1
- crackerjack/code_cleaner.py +58 -117
- crackerjack/config/global_lock_config.py +8 -48
- crackerjack/config/hooks.py +53 -62
- crackerjack/core/async_workflow_orchestrator.py +24 -34
- crackerjack/core/autofix_coordinator.py +3 -17
- crackerjack/core/enhanced_container.py +4 -13
- crackerjack/core/file_lifecycle.py +12 -89
- crackerjack/core/performance.py +2 -2
- crackerjack/core/performance_monitor.py +15 -55
- crackerjack/core/phase_coordinator.py +104 -204
- crackerjack/core/resource_manager.py +14 -90
- crackerjack/core/service_watchdog.py +62 -95
- crackerjack/core/session_coordinator.py +149 -0
- crackerjack/core/timeout_manager.py +14 -72
- crackerjack/core/websocket_lifecycle.py +13 -78
- crackerjack/core/workflow_orchestrator.py +171 -174
- crackerjack/docs/INDEX.md +11 -0
- crackerjack/docs/generated/api/API_REFERENCE.md +10895 -0
- crackerjack/docs/generated/api/CLI_REFERENCE.md +109 -0
- crackerjack/docs/generated/api/CROSS_REFERENCES.md +1755 -0
- crackerjack/docs/generated/api/PROTOCOLS.md +3 -0
- crackerjack/docs/generated/api/SERVICES.md +1252 -0
- crackerjack/documentation/__init__.py +31 -0
- crackerjack/documentation/ai_templates.py +756 -0
- crackerjack/documentation/dual_output_generator.py +765 -0
- crackerjack/documentation/mkdocs_integration.py +518 -0
- crackerjack/documentation/reference_generator.py +977 -0
- crackerjack/dynamic_config.py +55 -50
- crackerjack/executors/async_hook_executor.py +10 -15
- crackerjack/executors/cached_hook_executor.py +117 -43
- crackerjack/executors/hook_executor.py +8 -34
- crackerjack/executors/hook_lock_manager.py +26 -183
- crackerjack/executors/individual_hook_executor.py +13 -11
- crackerjack/executors/lsp_aware_hook_executor.py +270 -0
- crackerjack/executors/tool_proxy.py +417 -0
- crackerjack/hooks/lsp_hook.py +79 -0
- crackerjack/intelligence/adaptive_learning.py +25 -10
- crackerjack/intelligence/agent_orchestrator.py +2 -5
- crackerjack/intelligence/agent_registry.py +34 -24
- crackerjack/intelligence/agent_selector.py +5 -7
- crackerjack/interactive.py +17 -6
- crackerjack/managers/async_hook_manager.py +0 -1
- crackerjack/managers/hook_manager.py +79 -1
- crackerjack/managers/publish_manager.py +44 -8
- crackerjack/managers/test_command_builder.py +1 -15
- crackerjack/managers/test_executor.py +1 -3
- crackerjack/managers/test_manager.py +98 -7
- crackerjack/managers/test_manager_backup.py +10 -9
- crackerjack/mcp/cache.py +2 -2
- crackerjack/mcp/client_runner.py +1 -1
- crackerjack/mcp/context.py +191 -68
- crackerjack/mcp/dashboard.py +7 -5
- crackerjack/mcp/enhanced_progress_monitor.py +31 -28
- crackerjack/mcp/file_monitor.py +30 -23
- crackerjack/mcp/progress_components.py +31 -21
- crackerjack/mcp/progress_monitor.py +50 -53
- crackerjack/mcp/rate_limiter.py +6 -6
- crackerjack/mcp/server_core.py +17 -16
- crackerjack/mcp/service_watchdog.py +2 -1
- crackerjack/mcp/state.py +4 -7
- crackerjack/mcp/task_manager.py +11 -9
- crackerjack/mcp/tools/core_tools.py +173 -32
- crackerjack/mcp/tools/error_analyzer.py +3 -2
- crackerjack/mcp/tools/execution_tools.py +8 -10
- crackerjack/mcp/tools/execution_tools_backup.py +42 -30
- crackerjack/mcp/tools/intelligence_tool_registry.py +7 -5
- crackerjack/mcp/tools/intelligence_tools.py +5 -2
- crackerjack/mcp/tools/monitoring_tools.py +33 -70
- crackerjack/mcp/tools/proactive_tools.py +24 -11
- crackerjack/mcp/tools/progress_tools.py +5 -8
- crackerjack/mcp/tools/utility_tools.py +20 -14
- crackerjack/mcp/tools/workflow_executor.py +62 -40
- crackerjack/mcp/websocket/app.py +8 -0
- crackerjack/mcp/websocket/endpoints.py +352 -357
- crackerjack/mcp/websocket/jobs.py +40 -57
- crackerjack/mcp/websocket/monitoring_endpoints.py +2935 -0
- crackerjack/mcp/websocket/server.py +7 -25
- crackerjack/mcp/websocket/websocket_handler.py +6 -17
- crackerjack/mixins/__init__.py +0 -2
- crackerjack/mixins/error_handling.py +1 -70
- crackerjack/models/config.py +12 -1
- crackerjack/models/config_adapter.py +49 -1
- crackerjack/models/protocols.py +122 -122
- crackerjack/models/resource_protocols.py +55 -210
- crackerjack/monitoring/ai_agent_watchdog.py +13 -13
- crackerjack/monitoring/metrics_collector.py +426 -0
- crackerjack/monitoring/regression_prevention.py +8 -8
- crackerjack/monitoring/websocket_server.py +643 -0
- crackerjack/orchestration/advanced_orchestrator.py +11 -6
- crackerjack/orchestration/coverage_improvement.py +3 -3
- crackerjack/orchestration/execution_strategies.py +26 -6
- crackerjack/orchestration/test_progress_streamer.py +8 -5
- crackerjack/plugins/base.py +2 -2
- crackerjack/plugins/hooks.py +7 -0
- crackerjack/plugins/managers.py +11 -8
- crackerjack/security/__init__.py +0 -1
- crackerjack/security/audit.py +6 -35
- crackerjack/services/anomaly_detector.py +392 -0
- crackerjack/services/api_extractor.py +615 -0
- crackerjack/services/backup_service.py +2 -2
- crackerjack/services/bounded_status_operations.py +15 -152
- crackerjack/services/cache.py +127 -1
- crackerjack/services/changelog_automation.py +395 -0
- crackerjack/services/config.py +15 -9
- crackerjack/services/config_merge.py +19 -80
- crackerjack/services/config_template.py +506 -0
- crackerjack/services/contextual_ai_assistant.py +48 -22
- crackerjack/services/coverage_badge_service.py +171 -0
- crackerjack/services/coverage_ratchet.py +27 -25
- crackerjack/services/debug.py +3 -3
- crackerjack/services/dependency_analyzer.py +460 -0
- crackerjack/services/dependency_monitor.py +14 -11
- crackerjack/services/documentation_generator.py +491 -0
- crackerjack/services/documentation_service.py +675 -0
- crackerjack/services/enhanced_filesystem.py +6 -5
- crackerjack/services/enterprise_optimizer.py +865 -0
- crackerjack/services/error_pattern_analyzer.py +676 -0
- crackerjack/services/file_hasher.py +1 -1
- crackerjack/services/git.py +8 -25
- crackerjack/services/health_metrics.py +10 -8
- crackerjack/services/heatmap_generator.py +735 -0
- crackerjack/services/initialization.py +11 -30
- crackerjack/services/input_validator.py +5 -97
- crackerjack/services/intelligent_commit.py +327 -0
- crackerjack/services/log_manager.py +15 -12
- crackerjack/services/logging.py +4 -3
- crackerjack/services/lsp_client.py +628 -0
- crackerjack/services/memory_optimizer.py +19 -87
- crackerjack/services/metrics.py +42 -33
- crackerjack/services/parallel_executor.py +9 -67
- crackerjack/services/pattern_cache.py +1 -1
- crackerjack/services/pattern_detector.py +6 -6
- crackerjack/services/performance_benchmarks.py +18 -59
- crackerjack/services/performance_cache.py +20 -81
- crackerjack/services/performance_monitor.py +27 -95
- crackerjack/services/predictive_analytics.py +510 -0
- crackerjack/services/quality_baseline.py +234 -0
- crackerjack/services/quality_baseline_enhanced.py +646 -0
- crackerjack/services/quality_intelligence.py +785 -0
- crackerjack/services/regex_patterns.py +618 -524
- crackerjack/services/regex_utils.py +43 -123
- crackerjack/services/secure_path_utils.py +5 -164
- crackerjack/services/secure_status_formatter.py +30 -141
- crackerjack/services/secure_subprocess.py +11 -92
- crackerjack/services/security.py +9 -41
- crackerjack/services/security_logger.py +12 -24
- crackerjack/services/server_manager.py +124 -16
- crackerjack/services/status_authentication.py +16 -159
- crackerjack/services/status_security_manager.py +4 -131
- crackerjack/services/thread_safe_status_collector.py +19 -125
- crackerjack/services/unified_config.py +21 -13
- crackerjack/services/validation_rate_limiter.py +5 -54
- crackerjack/services/version_analyzer.py +459 -0
- crackerjack/services/version_checker.py +1 -1
- crackerjack/services/websocket_resource_limiter.py +10 -144
- crackerjack/services/zuban_lsp_service.py +390 -0
- crackerjack/slash_commands/__init__.py +2 -7
- crackerjack/slash_commands/run.md +2 -2
- crackerjack/tools/validate_input_validator_patterns.py +14 -40
- crackerjack/tools/validate_regex_patterns.py +19 -48
- {crackerjack-0.33.0.dist-info → crackerjack-0.33.2.dist-info}/METADATA +196 -25
- crackerjack-0.33.2.dist-info/RECORD +229 -0
- crackerjack/CLAUDE.md +0 -207
- crackerjack/RULES.md +0 -380
- crackerjack/py313.py +0 -234
- crackerjack-0.33.0.dist-info/RECORD +0 -187
- {crackerjack-0.33.0.dist-info → crackerjack-0.33.2.dist-info}/WHEEL +0 -0
- {crackerjack-0.33.0.dist-info → crackerjack-0.33.2.dist-info}/entry_points.txt +0 -0
- {crackerjack-0.33.0.dist-info → crackerjack-0.33.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Performance monitoring and metrics collection for async operations.
|
|
3
|
-
|
|
4
|
-
This module provides comprehensive monitoring of async operations,
|
|
5
|
-
timeout tracking, and performance analysis capabilities.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
1
|
import json
|
|
9
2
|
import logging
|
|
10
3
|
import time
|
|
@@ -22,8 +15,6 @@ logger = logging.getLogger("crackerjack.performance_monitor")
|
|
|
22
15
|
|
|
23
16
|
@dataclass
|
|
24
17
|
class OperationMetrics:
|
|
25
|
-
"""Metrics for a specific operation."""
|
|
26
|
-
|
|
27
18
|
operation_name: str
|
|
28
19
|
total_calls: int = 0
|
|
29
20
|
successful_calls: int = 0
|
|
@@ -36,21 +27,18 @@ class OperationMetrics:
|
|
|
36
27
|
|
|
37
28
|
@property
|
|
38
29
|
def success_rate(self) -> float:
|
|
39
|
-
"""Calculate success rate as percentage."""
|
|
40
30
|
if self.total_calls == 0:
|
|
41
31
|
return 0.0
|
|
42
32
|
return (self.successful_calls / self.total_calls) * 100
|
|
43
33
|
|
|
44
34
|
@property
|
|
45
35
|
def average_time(self) -> float:
|
|
46
|
-
"""Calculate average execution time."""
|
|
47
36
|
if self.successful_calls == 0:
|
|
48
37
|
return 0.0
|
|
49
38
|
return self.total_time / self.successful_calls
|
|
50
39
|
|
|
51
40
|
@property
|
|
52
41
|
def recent_average_time(self) -> float:
|
|
53
|
-
"""Calculate recent average execution time."""
|
|
54
42
|
if not self.recent_times:
|
|
55
43
|
return 0.0
|
|
56
44
|
return sum(self.recent_times) / len(self.recent_times)
|
|
@@ -58,8 +46,6 @@ class OperationMetrics:
|
|
|
58
46
|
|
|
59
47
|
@dataclass
|
|
60
48
|
class TimeoutEvent:
|
|
61
|
-
"""Record of a timeout event."""
|
|
62
|
-
|
|
63
49
|
operation: str
|
|
64
50
|
expected_timeout: float
|
|
65
51
|
actual_duration: float
|
|
@@ -68,18 +54,14 @@ class TimeoutEvent:
|
|
|
68
54
|
|
|
69
55
|
|
|
70
56
|
class AsyncPerformanceMonitor:
|
|
71
|
-
"""Monitor and track performance of async operations."""
|
|
72
|
-
|
|
73
57
|
def __init__(self, max_timeout_events: int = 1000) -> None:
|
|
74
58
|
self.metrics: dict[str, OperationMetrics] = {}
|
|
75
59
|
self.timeout_events: deque[TimeoutEvent] = deque(maxlen=max_timeout_events)
|
|
76
60
|
self._lock = Lock()
|
|
77
61
|
self.start_time = time.time()
|
|
78
62
|
|
|
79
|
-
# Circuit breaker tracking
|
|
80
63
|
self.circuit_breaker_events: dict[str, list[float]] = defaultdict(list)
|
|
81
64
|
|
|
82
|
-
# Performance thresholds
|
|
83
65
|
self.performance_thresholds: dict[str, dict[str, float]] = {
|
|
84
66
|
"default": {
|
|
85
67
|
"warning_time": 30.0,
|
|
@@ -119,11 +101,9 @@ class AsyncPerformanceMonitor:
|
|
|
119
101
|
}
|
|
120
102
|
|
|
121
103
|
def record_operation_start(self, operation: str) -> float:
|
|
122
|
-
"""Record the start of an operation."""
|
|
123
104
|
return time.time()
|
|
124
105
|
|
|
125
106
|
def record_operation_success(self, operation: str, start_time: float) -> None:
|
|
126
|
-
"""Record successful completion of an operation."""
|
|
127
107
|
duration = time.time() - start_time
|
|
128
108
|
|
|
129
109
|
with self._lock:
|
|
@@ -139,7 +119,6 @@ class AsyncPerformanceMonitor:
|
|
|
139
119
|
metrics.recent_times.append(duration)
|
|
140
120
|
|
|
141
121
|
def record_operation_failure(self, operation: str, start_time: float) -> None:
|
|
142
|
-
"""Record failed completion of an operation."""
|
|
143
122
|
duration = time.time() - start_time
|
|
144
123
|
|
|
145
124
|
with self._lock:
|
|
@@ -161,7 +140,6 @@ class AsyncPerformanceMonitor:
|
|
|
161
140
|
expected_timeout: float,
|
|
162
141
|
error_message: str = "",
|
|
163
142
|
) -> None:
|
|
164
|
-
"""Record timeout of an operation."""
|
|
165
143
|
duration = time.time() - start_time
|
|
166
144
|
|
|
167
145
|
with self._lock:
|
|
@@ -172,7 +150,6 @@ class AsyncPerformanceMonitor:
|
|
|
172
150
|
metrics.total_calls += 1
|
|
173
151
|
metrics.timeout_calls += 1
|
|
174
152
|
|
|
175
|
-
# Record timeout event
|
|
176
153
|
timeout_event = TimeoutEvent(
|
|
177
154
|
operation=operation,
|
|
178
155
|
expected_timeout=expected_timeout,
|
|
@@ -183,28 +160,23 @@ class AsyncPerformanceMonitor:
|
|
|
183
160
|
self.timeout_events.append(timeout_event)
|
|
184
161
|
|
|
185
162
|
def record_circuit_breaker_event(self, operation: str, opened: bool) -> None:
|
|
186
|
-
"""Record circuit breaker state change."""
|
|
187
163
|
with self._lock:
|
|
188
164
|
if opened:
|
|
189
165
|
self.circuit_breaker_events[operation].append(time.time())
|
|
190
166
|
|
|
191
167
|
def get_operation_metrics(self, operation: str) -> OperationMetrics | None:
|
|
192
|
-
"""Get metrics for a specific operation."""
|
|
193
168
|
with self._lock:
|
|
194
169
|
return self.metrics.get(operation)
|
|
195
170
|
|
|
196
171
|
def get_all_metrics(self) -> dict[str, OperationMetrics]:
|
|
197
|
-
"""Get all operation metrics."""
|
|
198
172
|
with self._lock:
|
|
199
173
|
return self.metrics.copy()
|
|
200
174
|
|
|
201
175
|
def get_recent_timeout_events(self, limit: int = 10) -> list[TimeoutEvent]:
|
|
202
|
-
"""Get recent timeout events."""
|
|
203
176
|
with self._lock:
|
|
204
|
-
return list(self.timeout_events)[-limit:]
|
|
177
|
+
return list[t.Any](self.timeout_events)[-limit:]
|
|
205
178
|
|
|
206
179
|
def get_performance_alerts(self) -> list[dict[str, t.Any]]:
|
|
207
|
-
"""Get current performance alerts."""
|
|
208
180
|
alerts = []
|
|
209
181
|
|
|
210
182
|
with self._lock:
|
|
@@ -213,7 +185,6 @@ class AsyncPerformanceMonitor:
|
|
|
213
185
|
operation, self.performance_thresholds["default"]
|
|
214
186
|
)
|
|
215
187
|
|
|
216
|
-
# Check success rate
|
|
217
188
|
if metrics.success_rate < thresholds["min_success_rate"]:
|
|
218
189
|
alerts.append(
|
|
219
190
|
{
|
|
@@ -227,7 +198,6 @@ class AsyncPerformanceMonitor:
|
|
|
227
198
|
}
|
|
228
199
|
)
|
|
229
200
|
|
|
230
|
-
# Check average response time
|
|
231
201
|
avg_time = metrics.recent_average_time
|
|
232
202
|
if avg_time > thresholds["critical_time"]:
|
|
233
203
|
alerts.append(
|
|
@@ -253,7 +223,6 @@ class AsyncPerformanceMonitor:
|
|
|
253
223
|
return alerts
|
|
254
224
|
|
|
255
225
|
def get_summary_stats(self) -> dict[str, t.Any]:
|
|
256
|
-
"""Get summary statistics."""
|
|
257
226
|
with self._lock:
|
|
258
227
|
total_calls = sum(m.total_calls for m in self.metrics.values())
|
|
259
228
|
total_successes = sum(m.successful_calls for m in self.metrics.values())
|
|
@@ -282,7 +251,6 @@ class AsyncPerformanceMonitor:
|
|
|
282
251
|
}
|
|
283
252
|
|
|
284
253
|
def export_metrics_json(self, filepath: Path) -> None:
|
|
285
|
-
"""Export metrics to JSON file."""
|
|
286
254
|
with self._lock:
|
|
287
255
|
data = {
|
|
288
256
|
"summary": self.get_summary_stats(),
|
|
@@ -308,7 +276,7 @@ class AsyncPerformanceMonitor:
|
|
|
308
276
|
"timestamp": event.timestamp,
|
|
309
277
|
"error_message": event.error_message,
|
|
310
278
|
}
|
|
311
|
-
for event in list(self.timeout_events)[-50:]
|
|
279
|
+
for event in list[t.Any](self.timeout_events)[-50:]
|
|
312
280
|
],
|
|
313
281
|
"performance_alerts": self.get_performance_alerts(),
|
|
314
282
|
}
|
|
@@ -316,24 +284,21 @@ class AsyncPerformanceMonitor:
|
|
|
316
284
|
filepath.write_text(json.dumps(data, indent=2))
|
|
317
285
|
|
|
318
286
|
def print_performance_report(self, console: Console | None = None) -> None:
|
|
319
|
-
"""Print a formatted performance report."""
|
|
320
287
|
if console is None:
|
|
321
288
|
console = Console()
|
|
322
289
|
|
|
323
290
|
console.print("\n[bold blue]🔍 Async Performance Monitor Report[/bold blue]")
|
|
324
291
|
console.print("=" * 60)
|
|
325
292
|
|
|
326
|
-
# Summary stats
|
|
327
293
|
summary = self.get_summary_stats()
|
|
328
|
-
console.print(f"⏱️ Uptime: {summary['uptime_seconds']
|
|
294
|
+
console.print(f"⏱️ Uptime: {summary['uptime_seconds']: .1f}s")
|
|
329
295
|
console.print(f"📊 Total Operations: {summary['total_operations']}")
|
|
330
|
-
console.print(f"✅ Success Rate: {summary['overall_success_rate']
|
|
331
|
-
console.print(f"⏰ Timeout Rate: {summary['timeout_rate']
|
|
332
|
-
console.print(f"🚀 Operations/min: {summary['operations_per_minute']
|
|
296
|
+
console.print(f"✅ Success Rate: {summary['overall_success_rate']: .1f}%")
|
|
297
|
+
console.print(f"⏰ Timeout Rate: {summary['timeout_rate']: .1f}%")
|
|
298
|
+
console.print(f"🚀 Operations/min: {summary['operations_per_minute']: .1f}")
|
|
333
299
|
|
|
334
|
-
# Operation metrics table
|
|
335
300
|
if self.metrics:
|
|
336
|
-
console.print("\n[bold]Operation Metrics:[/bold]")
|
|
301
|
+
console.print("\n[bold]Operation Metrics: [/bold]")
|
|
337
302
|
table = Table()
|
|
338
303
|
table.add_column("Operation")
|
|
339
304
|
table.add_column("Calls")
|
|
@@ -347,42 +312,38 @@ class AsyncPerformanceMonitor:
|
|
|
347
312
|
table.add_row(
|
|
348
313
|
name,
|
|
349
314
|
str(metrics.total_calls),
|
|
350
|
-
f"{metrics.success_rate
|
|
351
|
-
f"{metrics.average_time
|
|
352
|
-
f"{metrics.recent_average_time
|
|
315
|
+
f"{metrics.success_rate: .1f}%",
|
|
316
|
+
f"{metrics.average_time: .2f}s",
|
|
317
|
+
f"{metrics.recent_average_time: .2f}s",
|
|
353
318
|
str(metrics.timeout_calls),
|
|
354
319
|
)
|
|
355
320
|
|
|
356
321
|
console.print(table)
|
|
357
322
|
|
|
358
|
-
# Performance alerts
|
|
359
323
|
alerts = self.get_performance_alerts()
|
|
360
324
|
if alerts:
|
|
361
|
-
console.print("\n[bold red]⚠️ Performance Alerts:[/bold red]")
|
|
325
|
+
console.print("\n[bold red]⚠️ Performance Alerts: [/bold red]")
|
|
362
326
|
for alert in alerts:
|
|
363
327
|
severity_emoji = "🔴" if alert["severity"] == "critical" else "🟡"
|
|
364
328
|
console.print(
|
|
365
329
|
f"{severity_emoji} {alert['operation']}: {alert['type']} "
|
|
366
|
-
f"{alert['current_value']
|
|
330
|
+
f"{alert['current_value']: .1f} (threshold: {alert['threshold']: .1f})"
|
|
367
331
|
)
|
|
368
332
|
|
|
369
|
-
# Recent timeouts
|
|
370
333
|
recent_timeouts = self.get_recent_timeout_events(5)
|
|
371
334
|
if recent_timeouts:
|
|
372
|
-
console.print("\n[bold yellow]⏰ Recent Timeouts:[/bold yellow]")
|
|
335
|
+
console.print("\n[bold yellow]⏰ Recent Timeouts: [/bold yellow]")
|
|
373
336
|
for timeout in recent_timeouts:
|
|
374
337
|
console.print(
|
|
375
|
-
f"
|
|
376
|
-
f"(expected: {timeout.expected_timeout
|
|
338
|
+
f" • {timeout.operation}: {timeout.actual_duration: .1f}s "
|
|
339
|
+
f"(expected: {timeout.expected_timeout: .1f}s)"
|
|
377
340
|
)
|
|
378
341
|
|
|
379
342
|
|
|
380
|
-
# Global performance monitor instance
|
|
381
343
|
_global_performance_monitor: AsyncPerformanceMonitor | None = None
|
|
382
344
|
|
|
383
345
|
|
|
384
346
|
def get_performance_monitor() -> AsyncPerformanceMonitor:
|
|
385
|
-
"""Get the global performance monitor instance."""
|
|
386
347
|
global _global_performance_monitor
|
|
387
348
|
if _global_performance_monitor is None:
|
|
388
349
|
_global_performance_monitor = AsyncPerformanceMonitor()
|
|
@@ -390,6 +351,5 @@ def get_performance_monitor() -> AsyncPerformanceMonitor:
|
|
|
390
351
|
|
|
391
352
|
|
|
392
353
|
def reset_performance_monitor() -> None:
|
|
393
|
-
"""Reset the global performance monitor."""
|
|
394
354
|
global _global_performance_monitor
|
|
395
355
|
_global_performance_monitor = AsyncPerformanceMonitor()
|