Skip to main content
Glama

GitHub Copilot Response Time Statistics MCP Server

by fishcoderman
README.md2.97 kB
# GitHub Copilot 响应时间统计 MCP 服务 这是一个基于 Python 的 MCP(Model Context Protocol)服务,用于统计和对比 GitHub Copilot 以及其他 AI 模型的响应时间。 ## 功能特性 - 📊 实时记录模型响应时间 - 🔄 支持多个会话同时进行 - 📈 提供详细的统计分析 - 🏆 模型性能对比 - 💾 数据持久化存储 - 🛠️ 简单易用的 API ## 安装依赖 ```bash pip install -r requirements.txt ``` ## 快速开始 ### 1. 启动 MCP 服务 ```bash python index.py ``` ### 2. 基本使用流程 ```python # 开始记录一个问题的响应时间 start_question_timing( session_id="unique-session-1", model_name="GitHub Copilot", question="如何优化Python代码性能?" ) # 向模型提问并等待回答... # 收到回答后结束记录 end_question_timing(session_id="unique-session-1") ``` ### 3. 查看统计结果 ```python # 查看特定模型的统计 get_model_statistics(model_name="GitHub Copilot") # 对比所有模型性能 compare_all_models() ``` ## API 工具说明 ### 核心工具 - **`start_question_timing`** - 开始记录响应时间 - **`end_question_timing`** - 结束记录并计算时间 - **`get_model_statistics`** - 获取统计数据 - **`compare_all_models`** - 模型性能对比 ### 辅助工具 - **`get_active_sessions`** - 查看活动会话 - **`clear_all_data`** - 清除所有数据 - **`resource://usage`** - 使用指南 ## 数据结构 每条记录包含以下信息: - 模型名称 - 问题内容 - 开始时间戳 - 结束时间戳 - 响应时间(毫秒) - 记录时间 - 会话ID ## 使用示例 ### 测试不同模型 ```python # 测试 GitHub Copilot start_question_timing("test-1", "GitHub Copilot", "创建REST API") # ... 向 Copilot 提问 ... end_question_timing("test-1") # 测试 Claude start_question_timing("test-2", "Claude-3", "创建REST API") # ... 向 Claude 提问 ... end_question_timing("test-2") # 对比结果 compare_all_models() ``` ### 批量测试 运行示例客户端查看完整演示: ```bash python client_example.py ``` ## 数据存储 - 所有数据自动保存到 `response_stats.json` - 支持服务重启后数据恢复 - JSON 格式便于数据分析 ## 注意事项 1. **会话ID唯一性** - 确保每个测试使用唯一的会话ID 2. **及时结束计时** - 收到回答后立即调用 `end_question_timing` 3. **数据备份** - 定期备份 `response_stats.json` 文件 ## 实际使用场景 ### 1. 对比不同AI模型 测试同一个问题在不同AI模型上的响应速度 ### 2. 模型性能监控 长期跟踪特定模型的响应时间趋势 ### 3. 优化提示词 测试不同的提示词对响应时间的影响 ### 4. 服务质量评估 为AI服务选择提供数据支持 ## 扩展功能 可以轻松扩展以支持: - 响应质量评分 - 更复杂的统计分析 - 图表可视化 - 导出报告功能 ## 许可证 MIT License

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fishcoderman/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server