Skip to content

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

Open
chengxilo wants to merge 3 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 3 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 71.72%. Comparing base (b55d065) to head (d3f5b66).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3032      +/-   ##
============================================
- Coverage     71.74%   71.72%   -0.03%     
  Complexity      930      930              
============================================
  Files          1121     1103      -18     
  Lines         93777    91606    -2171     
  Branches      71125    68920    -2205     
============================================
- Hits          67284    65706    -1578     
+ Misses        23856    23449     -407     
+ Partials       2637     2451     -186     
Components Coverage Δ
Rust Core 72.32% <ø> (-0.02%) ⬇️
Java SDK 62.08% <ø> (ø)
C# SDK 67.64% <ø> (ø)
Python SDK 81.43% <ø> (ø)
Node SDK 91.44% <ø> (-0.10%) ⬇️
Go SDK 39.09% <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 154 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.

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.

1 participant