Skip to content

fix(go): update stats field and its deserialization logic to align with rust SDK#3032

Open
chengxilo wants to merge 5 commits intoapache:masterfrom
chengxilo:update-stats
Open

fix(go): update stats field and its deserialization logic to align with rust SDK#3032
chengxilo wants to merge 5 commits intoapache:masterfrom
chengxilo:update-stats

Conversation

@chengxilo
Copy link
Copy Markdown
Contributor

@chengxilo chengxilo commented Mar 26, 2026

Which issue does this PR close?

Address #2964 (comment)

Rationale

The rust side now serializes threads_count, free_disk_space, and total_disk_space on the wire (in core/server/src/binary/mapper.rs), but the go Stats struct (foreign/go/contracts/stats.go) and its deserializer (foreign/go/binary_serialization/stats_serializer.go) don't read these fields.

(Yeah, I copied the comment) 😋

What changed?

  1. Adds attributes to Stats, also the tests.
  2. Removed TcpStats and update the function related to it as Stats is already enough for our logic.
  3. Refactor Stats deserialization logic with reader introduced in feat(go): implement binary reader/writer #2986

Local Execution

  • Passed
  • Pre-commit hooks ran

AI Usage

  1. Claude Opus 4.6
  2. Code generation and review.
  3. I checked it with the rust implementation of stats.
  4. Yes.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.68%. Comparing base (051475a) to head (5809769).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3032      +/-   ##
============================================
+ Coverage     70.52%   70.68%   +0.16%     
  Complexity      943      943              
============================================
  Files          1115     1113       -2     
  Lines         95388    94495     -893     
  Branches      72589    71663     -926     
============================================
- Hits          67275    66798     -477     
+ Misses        25634    25230     -404     
+ Partials       2479     2467      -12     
Components Coverage Δ
Rust Core 70.75% <ø> (+0.18%) ⬆️
Java SDK 62.30% <ø> (ø)
C# SDK 69.40% <ø> (ø)
Python SDK 81.43% <ø> (ø)
Node SDK 91.53% <ø> (+0.12%) ⬆️
Go SDK 39.37% <100.00%> (+0.40%) ⬆️
Files with missing lines Coverage Δ
foreign/go/client/tcp/tcp_utilities.go 80.00% <100.00%> (ø)
foreign/go/contracts/stats.go 100.00% <100.00%> (ø)

... and 35 files with indirect coverage changes

🚀 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.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs.

If you need a review, please ensure CI is green and the PR is rebased on the latest master. Don't hesitate to ping the maintainers - either @core on Discord or by mentioning them directly here on the PR.

Thank you for your contribution!

@github-actions github-actions bot added the stale Inactive issue or pull request label Apr 8, 2026
@github-actions github-actions bot removed the stale Inactive issue or pull request label Apr 9, 2026
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