MCPcopy
hub / github.com/HisMax/RedInk / get_statistics

Method get_statistics

backend/services/history.py:522–550  ·  view source on GitHub ↗

获取历史记录统计信息 Returns: Dict: 统计数据 - total: 总记录数 - by_status: 各状态的记录数 - draft: 草稿数 - generating: 生成中数 - partial: 部分完成数 - completed: 已完成数 - err

(self)

Source from the content-addressed store, hash-verified

520 return results
521
522 def get_statistics(self) -> Dict:
523 """
524 获取历史记录统计信息
525
526 Returns:
527 Dict: 统计数据
528 - total: 总记录数
529 - by_status: 各状态的记录数
530 - draft: 草稿数
531 - generating: 生成中数
532 - partial: 部分完成数
533 - completed: 已完成数
534 - error: 错误数
535 """
536 index = self._load_index()
537 records = index.get("records", [])
538
539 total = len(records)
540 status_count = {}
541
542 # 统计各状态的记录数
543 for record in records:
544 status = record.get("status", RecordStatus.DRAFT)
545 status_count[status] = status_count.get(status, 0) + 1
546
547 return {
548 "total": total,
549 "by_status": status_count
550 }
551
552 def scan_and_sync_task_images(self, task_id: str) -> Dict[str, Any]:
553 """

Callers 1

get_history_statsFunction · 0.80

Calls 2

_load_indexMethod · 0.95
getMethod · 0.80

Tested by

no test coverage detected