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

Offen
#2,135 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
65/100
Issue-Typ
Feature
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
graphql, typescript
Bereich
api, backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
TypeScript
Sterne
123
Forks
25
Ø Merge
2 T. 16 Std.
Gemergte PRs (30 T.)
9

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus unraid/api

Alle Issues in unraid/api

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.