Feature: Expose parity check estimated remaining time and elapsed seconds in GraphQL schema

Đang mở
#2,135 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
graphql, typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

Start with getParityCheckStatus in api/src/core/utils/clients/emcmd.ts, which already computes speed, progress and duration from the var data, and check how the ParityCheck ObjectType in api/src/unraid-api/graph/resolvers/array/array.model.ts maps those fields. Work out the remaining-time formula from mdResyncSize, mdResyncPos, mdResyncDb and mdResyncDt and handle the zero or missing cases. Done means estimatedRemaining and elapsed appear as nullable seconds in the GraphQL schema and resolve correctly while a check is running.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Is your feature request related to a problem?

When a parity check or disk rebuild/sync is in progress on Unraid OS, client integrations (such as Home Assistant, Unraid Connect, and third-party dashboards) need to display elapsed time and estimated time to completion.

Currently, the Unraid WebGUI (Dynamix) calculates these values locally on-the-fly from /var/local/emhttp/var.ini:

  • Elapsed time: now - sbSynced
  • Estimated finish: (mdResyncSize - mdResyncPos) / (mdResyncDb / mdResyncDt)

However, in unraid/api, while getParityCheckStatus(varData) already computes speed, progress, and duration (now - sbSynced), it does not compute or expose an estimated / estimatedRemaining field in the GraphQL schema, and duration is not aliased or documented as elapsed. As a result, API clients are unable to display accurate completion estimates without reverse-engineering low-level driver variables.

Describe the solution you'd like

  1. In api/src/core/utils/clients/emcmd.ts (or getParityCheckStatus):
    • Add estimatedRemaining: number | undefined (remaining time in seconds), calculated from mdResyncSize, mdResyncPos, mdResyncDb, and mdResyncDt.
    • Expose elapsed: number | undefined alongside (or aliased to) duration.
  2. Update the ParityCheck GraphQL ObjectType in api/src/unraid-api/graph/resolvers/array/array.model.ts to include:
    • estimatedRemaining: Int (nullable, seconds remaining)
    • elapsed: Int (nullable, elapsed seconds)

Describe alternatives you've considered

Clients could attempt to query raw state or estimate completion client-side using progress and speed, but this introduces clock skew and inconsistent calculations between the WebGUI, Unraid Connect, and external integrations. Computing this server-side ensures a single source of truth across all consumers.

Environment (if relevant)

Unraid OS Version: 7.0.0+ / 7.2.0+

Pre-submission Checklist

  • I have searched existing issues to ensure this feature hasn't already been requested
  • This is not an Unraid Connect related feature
  • I have provided clear examples or use cases for the feature
Ngôn ngữ chính
TypeScript
Star
123
Fork
25
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của unraid/api

Tất cả issue của unraid/api

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.