Expose ZFS ARC size and maximum as optional read-only metrics
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 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 小时
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 天内回复