Skip to content

feat: add doc_url field to Profile message#81

Merged
szegedi merged 1 commit into
mainfrom
szegedi/profile-doc-url
Jul 24, 2026
Merged

feat: add doc_url field to Profile message#81
szegedi merged 1 commit into
mainfrom
szegedi/profile-doc-url

Conversation

@szegedi

@szegedi szegedi commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Adds the doc_url field (field 15, an int64 index into the string table) to the pprof Profile message: ProfileInput type, constructor, length, encode (varint, tag 0x78), and decode — mirroring the existing defaultSampleType field.

The pprof spec's Profile carries doc_url as a link to documentation for the profile; this library didn't encode or decode it, so a doc_url set on a profile was silently dropped on the wire.

Changes

  • src/index.tsdocUrl on the Profile message.
  • testing/proto/profile.proto — add int64 doc_url = 15; so the protobuf.js interop test round-trips the field; profile.js / profile.d.ts were hand-edited to add only doc_url in the existing codegen style (avoiding the unrelated churn a full npm run proto produces with the current protobuf.js version).
  • src/index.test.ts — encode/decode/default tests for Profile.docUrl.

Testing

npm test80/80 pass, including the protobuf.js interop round-trip.

Context

Follows #80 (which added Line.column). Together these sync pprof-format with the current pprof spec so a release can be cut, after which pprof-nodejs can adopt both (emitting a real Line.column for server-side unminification).

🤖 Generated with Claude Code

The pprof spec's Profile message carries doc_url (field 15, an int64 index into
the string table pointing at documentation for the profile). Add it to the
Profile message — ProfileInput type, constructor, length, encode (field 15,
varint), and decode — mirroring the existing defaultSampleType field.

Also add doc_url to the reference testing proto so the protobuf.js interop test
round-trips it, and add Profile encode/decode tests for it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@szegedi
szegedi requested review from a team as code owners July 24, 2026 08:21
@szegedi
szegedi merged commit 51c36fc into main Jul 24, 2026
13 checks passed
@szegedi
szegedi deleted the szegedi/profile-doc-url branch July 24, 2026 10:15
@szegedi szegedi mentioned this pull request Jul 24, 2026
szegedi added a commit that referenced this pull request Jul 24, 2026
The pprof spec's Profile message carries doc_url (field 15, an int64 index into
the string table pointing at documentation for the profile). Add it to the
Profile message — ProfileInput type, constructor, length, encode (field 15,
varint), and decode — mirroring the existing defaultSampleType field.

Also add doc_url to the reference testing proto so the protobuf.js interop test
round-trips it, and add Profile encode/decode tests for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants