Skip to content

feat(#90): add getTotalCost() and getTagThrottledDuration() - #102

Merged
s2x merged 1 commit into
masterfrom
feat/90-transaction-cost-introspection
Sep 8, 2026
Merged

feat(#90): add getTotalCost() and getTagThrottledDuration()#102
s2x merged 1 commit into
masterfrom
feat/90-transaction-cost-introspection

Conversation

@s2x

@s2x s2x commented Sep 8, 2026

Copy link
Copy Markdown
Member

Closes #90

What changed

  • NativeClient: added FFI declarations for fdb_transaction_get_total_cost, fdb_transaction_get_tag_throttled_duration and fdb_future_get_double.
  • New Future\FutureDouble future type (the throttled-duration future resolves to a double in C).
  • ReadTransaction::getTotalCost(): FutureInt64 and ReadTransaction::getTagThrottledDuration(): FutureDouble — inherited by both Transaction and Snapshot.
  • docs/transactions.md updated; CHANGELOG.md entry added.

Tests

  • Unit: tests/Unit/FutureDoubleTest.php (compiled C stub, same pattern as FutureBoolTest).
  • Integration: tests/Integration/TransactionIntrospectionTest.php — cost grows with writes, 0.0 throttled duration on an unthrottled cluster, both accessible on snapshots. Verified against the local 5-node Docker cluster.
  • composer lint (PHPCS + Rector dry-run + PHPStan L9) and composer test clean locally.

@s2x
s2x merged commit 0d84568 into master Sep 8, 2026
6 checks passed
@s2x
s2x deleted the feat/90-transaction-cost-introspection branch September 8, 2026 20:37
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.

Add Transaction::getTotalCost() and getTagThrottledDuration()

1 participant