reset_performance_stats
Reset performance statistics within the Image Processing MCP Server to clear accumulated data and restore default tracking for accurate monitoring and analysis.
Instructions
重置性能统计信息
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:808-821 (handler)MCP tool handler decorated with @mcp.tool() that executes the reset by calling utils_reset_performance_stats() and returns JSON response.@mcp.tool() def reset_performance_stats() -> str: """重置性能统计信息""" try: utils_reset_performance_stats() return json.dumps({ "success": True, "message": "性能统计已重置" }, ensure_ascii=False, indent=2) except Exception as e: return json.dumps({ "success": False, "error": f"重置性能统计失败: {str(e)}" }, ensure_ascii=False, indent=2)
- utils/performance.py:360-366 (helper)Core helper function that resets the global performance monitor instance, clears the image cache, and triggers memory cleanup.def reset_performance_stats(): """重置性能统计""" global performance_monitor, image_cache performance_monitor = PerformanceMonitor() image_cache.clear() resource_manager.cleanup_memory()
- main.py:85-85 (registration)Import of the reset_performance_stats function from utils.performance, aliased for use in the MCP tool handler.from utils.performance import get_performance_stats as utils_get_performance_stats, reset_performance_stats as utils_reset_performance_stats