fix(function): type memory as breakdown, not a single number#5
Merged
Conversation
The API now returns profiling.memory as {total,used,heap,external}
in bytes (isolated-function >=0.2 via @browserless/function 13.6.8),
not a single MB number.
Update FunctionProfiling.memory, the README table/example, and add
a tsd assertion for the four fields.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CTJQQb6p1UWdkireDjCVri
📝 WalkthroughWalkthroughThe function profiling memory field now uses an object with optional ChangesFunction profiling memory
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The API now returns
profiling.memoryas a{total,used,heap,external}breakdown (bytes), from isolated-function >=0.2 via@browserless/function13.6.8. The@microlink/functionclient still typed it asmemory?: numberand documented it as "Peak memory usage in MB" — both wrong now.What
FunctionProfiling.memory→{ total?, used?, heap?, external? }(bytes).tsdassertion for the four fields.Tests
tsdgreen,ava17 passed.Not touched
packages/coretypesprofilingasRecord<string, unknown>— already generic, no change.packages/mcpdescribesprofilingin prose only.🤖 Generated with Claude Code
Note
Low Risk
Documentation and TypeScript declarations only; no runtime client logic changed, though consumers treating
memoryas a number will need to update.Overview
Aligns
@microlink/functionwith the API:profiling.memoryis now typed and documented as a byte-level object (total,used,heap,external) instead of a single MB number.The README profiling example and field table were updated accordingly, and
tsdnow asserts the four optional numeric fields ondata.profiling.memory.Reviewed by Cursor Bugbot for commit 6cba0d9. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Documentation
TypeScript Improvements