MCPcopy Create free account
hub / github.com/Enfoirer/Text2GraphRAG / _show_system_stats

Method _show_system_stats

main.py:363–381  ·  view source on GitHub ↗

显示系统统计信息

(self)

Source from the content-addressed store, hash-verified

361 self._cleanup()
362
363 def _show_system_stats(self):
364 """显示系统统计信息"""
365 print("\n系统运行统计")
366 print("=" * 40)
367
368 # 路由统计
369 route_stats = self.query_router.get_route_statistics()
370 total_queries = route_stats.get('total_queries', 0)
371
372 if total_queries > 0:
373 print(f"总查询次数: {total_queries}")
374 print(f"传统检索: {route_stats.get('traditional_count', 0)} ({route_stats.get('traditional_ratio', 0):.1%})")
375 print(f"图RAG检索: {route_stats.get('graph_rag_count', 0)} ({route_stats.get('graph_rag_ratio', 0):.1%})")
376 print(f"组合策略: {route_stats.get('combined_count', 0)} ({route_stats.get('combined_ratio', 0):.1%})")
377 else:
378 print("暂无查询记录")
379
380 # 知识库统计
381 self._show_knowledge_base_stats()
382
383 def _rebuild_knowledge_base(self):
384 """重建知识库"""

Callers 1

run_interactiveMethod · 0.95

Calls 2

get_route_statisticsMethod · 0.80

Tested by

no test coverage detected