diagnostics_channel: add a channel for filesystem operations
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
描述
What is the problem this feature will solve?
node:diagnostics_channel does not currently expose a built-in channel for filesystem operations performed through node:fs and node:fs/promises.
The proposed scope is the public filesystem APIs. Calls made directly by native addons or arbitrary native code do not need to be included in this contract.
What is the feature you are proposing to solve the problem?
Add a built-in tracing channel family for filesystem operations. One possible naming scheme is:
tracing:fs.operation:starttracing:fs.operation:endtracing:fs.operation:asyncStarttracing:fs.operation:asyncEndtracing:fs.operation:error
The shared event object could contain:
operation: a stable operation name such asopen,read,stat,readdir, orrealpath.api:sync,callback,promise,stream, orfilehandle.- Path, source/destination, or file descriptor fields when applicable, preserving the value type passed by the caller.
resultanderrorfollowing the existingTracingChannelconventions.
Large read/write buffers should not be copied into event metadata. The exact publication layer—public API wrappers or the lowest shared internal filesystem layer—can be determined during implementation, but the documented payload should remain independent of internal FSReqCallback details.
Using one operation family with an operation field avoids requiring wildcard channel subscriptions while allowing subscribers to filter individual operations.
What alternatives have you considered?
Wrapping exports from node:fs and node:fs/promises is incomplete when references have already been captured and requires synchronization with named built-in ESM exports. async_hooks exposes asynchronous resource lifecycles rather than stable filesystem operation semantics and does not cover synchronous calls. Trace events use a different consumption API and payload contract.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从公开的 node:fs 和 node:fs/promises API 以及现有的 node:diagnostics_channel TracingChannel 约定入手;比较 sync、callback、promise、stream 和 filehandle 路径。确定发布层和 channel 名称,同时让 payload 不依赖 FSReqCallback 细节。完成标准是:受支持的公开文件系统操作会发布文档所述的生命周期事件和元数据。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, node.js
- 领域
- api, operating-systems
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100