Skip to content

Add getSqliteProcessMemoryUsed() to sqlite-metering - #8107

Open
jtolio wants to merge 1 commit into
mainfrom
jolio/add-getsqlit-nyla3p
Open

jtolio wants to merge 1 commit into
mainfrom
jolio/add-getsqlit-nyla3p

Conversation

@jtolio

@jtolio jtolio commented Oct 30, 2026

Copy link
Copy Markdown
Member

Exposes the bytes SQLite has allocated across all databases in the process, which is what the process-wide hard heap limit applies to, so callers outside workerd can report it without reaching into SQLite's C API.

@jtolio
jtolio requested review from a team as code owners October 30, 2026 17:12

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by the review of 18de89d6.

This review, of 816f9da5

✅ Approved — A small, correct wrapper around sqlite3_memory_used() with an accurate doc comment and a focused test. No issues found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

The wrapper is correct, and the test handles SQLite rounding allocation sizes up by checking with >=. The added build dependency is needed for the test's direct SQLite calls.


📝 Documentation: ✅ LGTM

The header comment on getSqliteProcessMemoryUsed() describes the current behavior accurately and points to the matching process-wide hard heap limit setting.


Reviewed commit: 816f9da5

@codecov-commenter

codecov-commenter commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.31%. Comparing base (5a8b162) to head (9985b3d).

Files with missing lines Patch % Lines
src/workerd/util/sqlite-metering-test.c++ 72.72% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8107      +/-   ##
==========================================
- Coverage   68.31%   68.31%   -0.01%     
==========================================
  Files         726      726              
  Lines      189681   189695      +14     
  Branches    29675    29678       +3     
==========================================
+ Hits       129581   129585       +4     
- Misses      42721    42727       +6     
- Partials    17379    17383       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jtolio
jtolio enabled auto-merge October 30, 2026 17:42
@jtolio
jtolio force-pushed the jolio/add-getsqlit-nyla3p branch from c2974b0 to 18de89d Compare October 30, 2026 21:30

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by the review of adef4a14.

This review, of 18de89d6

✅ Approved — A small, correct wrapper around sqlite3_memory_used() with an accurate doc comment and a focused test. No issues found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

The wrapper is correct, and the test handles SQLite rounding allocation sizes up by checking with >=. The added build dependency is needed for the test's direct SQLite calls.


📝 Documentation: ✅ LGTM

The header comment on getSqliteProcessMemoryUsed() describes the current behavior accurately and points to the matching process-wide hard heap limit setting.


Reviewed commit: 18de89d6 — same changes as 816f9da5, so this is that commit's review (no new review was run; line numbers are as of 816f9da5)

@jtolio
jtolio force-pushed the jolio/add-getsqlit-nyla3p branch from 18de89d to adef4a1 Compare October 30, 2026 23:48

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by the review of 9985b3df.

This review, of adef4a14

✅ Approved — No patches changed since the previous approved review. The change is still a small, correct wrapper around sqlite3_memory_used() with an accurate doc comment and a focused test. No issues found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

getSqliteProcessMemoryUsed() is a correct wrapper. Because SQLite rounds allocation sizes up, the test compares with >=, which avoids that problem. The new build dependency is needed because the test calls SQLite directly. Nothing has changed since the last review.


📝 Documentation: ✅ LGTM

The header comment on getSqliteProcessMemoryUsed() describes what the function does today. It also points to the process-wide hard heap limit that this value is measured against.


Reviewed commit: adef4a14

Exposes the bytes SQLite has allocated across all databases in the
process, which is what the process-wide hard heap limit applies to,
so callers outside workerd can report it without reaching into
SQLite's C API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtolio
jtolio force-pushed the jolio/add-getsqlit-nyla3p branch from adef4a1 to 9985b3d Compare November 2, 2026 14:17

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — No patches changed since the previous approved review. The change is still a small, correct wrapper around sqlite3_memory_used() with an accurate doc comment and a focused test. No issues found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

getSqliteProcessMemoryUsed() is a correct wrapper. Because SQLite rounds allocation sizes up, the test compares with >=, which avoids that problem. The new build dependency is needed because the test calls SQLite directly. Nothing has changed since the last review.


📝 Documentation: ✅ LGTM

The header comment on getSqliteProcessMemoryUsed() describes what the function does today. It also points to the process-wide hard heap limit that this value is measured against.


Reviewed commit: 9985b3df — same changes as adef4a14, so this is that commit's review (no new review was run; line numbers are as of adef4a14)

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.

3 participants