nodejs / nodejs/node

diagnostics_channel: add a channel for filesystem operations

Đang mở
#65,330 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

feature request
Ngôn ngữ chính
JavaScript
Star
122k
Fork
37.3k
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
283

Mô tả

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:start
  • tracing:fs.operation:end
  • tracing:fs.operation:asyncStart
  • tracing:fs.operation:asyncEnd
  • tracing:fs.operation:error

The shared event object could contain:

  • operation: a stable operation name such as open, read, stat, readdir, or realpath.
  • api: sync, callback, promise, stream, or filehandle.
  • Path, source/destination, or file descriptor fields when applicable, preserving the value type passed by the caller.
  • result and error following the existing TracingChannel conventions.

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với các API công khai node:fs và node:fs/promises cùng các quy ước TracingChannel hiện có của node:diagnostics_channel; so sánh các đường đi sync, callback, promise, stream và filehandle. Xác định lớp phát hành và tên các channel, đồng thời giữ cho payload độc lập với các chi tiết của FSReqCallback. Được xem là hoàn tất khi các thao tác hệ thống tệp công khai được hỗ trợ phát hành các sự kiện vòng đời và siêu dữ liệu đã được tài liệu hóa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, node.js
Lĩnh vực
api, operating-systems
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.