Expose ZFS ARC size and maximum as optional read-only metrics
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- graphql, typescript
調査の方向性
Start by locating the public GraphQL schema and the API code that collects MemoryUtilization; the issue does not name specific files or tests. Trace how existing memory metrics are read and exposed, then check the schema and tests for the relevant entry points. Done means optional, read-only ARC size and maximum fields report byte values or null when unavailable, with tests for the listed cases and existing memory behavior preserved.
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem?
Home Assistant users need ZFS ARC used bytes and percentage of the configured ARC maximum to replace a separate Glances installation. The standard Unraid API does not currently expose these values, so a typed client cannot provide them without bypassing the API.
This blocks the two ZFS-cache metrics in https://github.com/tinkerologie/ha-unraid/issues/202. The integration intentionally performs all Unraid I/O through the unraid-api Python client.
Describe the solution you'd like
Expose optional, read-only ARC size and ARC maximum values in the public metrics schema, for example nullable BigInt fields on MemoryUtilization (field names subject to maintainer preference). Read the current size and c_max counters from the fixed /proc/spl/kstat/zfs/arcstats source, without SMART calls, disk probes, shell execution, or disk wake-ups. Return null when ZFS/ARC stats are unavailable; do not substitute zero for unavailable data. Define both values in bytes, allowing clients to calculate size / c_max * 100.
Acceptance criteria:
- Public GraphQL schema exposes typed ARC size and maximum fields, with documented units and unavailable behavior.
- Collection remains read-only and does not spin up disks.
- Tests cover valid counters, unavailable ZFS, malformed/missing counters, and large values.
- Existing memory metrics retain their current behavior.
Describe alternatives you've considered
Glances, SSH collection, and the separate Unraid Management Agent can expose ARC data, but they introduce another service or bypass the standard Unraid API. HA template/group helpers cannot reconstruct ARC size or c_max from total/used/free/available memory. We do not want to manufacture an estimate or query undocumented file/log endpoints.
Additional context
Verified against live API 4.37.7+250d3663: the type list has no ARC/ZFS metrics type, and MemoryUtilization contains total, used, free, available, active, buffcache and swap metrics only. The published schema at https://github.com/unraid/api/blob/250d366375f3f004e4c02e9db1aede5a7a629705/api/generated-schema.graphql#L1808 confirms this. The Python client currently has no typed ARC fields either.
Once the server schema provides the capability, the Python client can detect it and expose optional fields without breaking older servers. The HA integration can then create ZFS cache sensors only for supported servers.
Environment (if relevant)
Unraid OS Version: 7.3.4; API 4.37.7+250d3663. The original request was raised on Unraid 7.2.4.
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
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
unraid/api のほかの issue
-
Temperature metrics: lm-sensors voltages, fan speeds and power are reported as temperatures (°C)オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullableオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mckinsey/agents-at-scale-ark#4091 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
factory:subtask
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
NUS-Project-SaBai/project-sabai#386 ·
メンテナーはふだん 3 日以内に返信
-
android needs clarification
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
super-productivity/super-productivity#12105 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信