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

オープン
#2,135 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
65/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
graphql, typescript
領域
api, backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
TypeScript
スター
123
フォーク
25
平均マージ
2日 16時間
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

unraid/api のほかの issue

unraid/api の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。