Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor zipkin/protov2.go #1747

Merged
merged 10 commits into from
Aug 21, 2019
Merged

Refactor zipkin/protov2.go #1747

merged 10 commits into from
Aug 21, 2019

Conversation

jan25
Copy link
Contributor

@jan25 jan25 commented Aug 20, 2019

Which problem is this PR solving?

Short description of the changes

  • Improve model/ids.go to parse []byte into SpanID/TraceID
  • Use model/ids.go in zipkin/protov2.go

jan25 added 4 commits August 19, 2019 20:38
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
jan25 added 3 commits August 20, 2019 20:45
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
Signed-off-by: Abhilash Gnan <[email protected]>
@jan25
Copy link
Contributor Author

jan25 commented Aug 20, 2019

crossdock-go test failed, i think its flaky and unrelated to this PR. Is there something we can do to fix that? so CI wouldn't break for any PRs in future

@codecov
Copy link

codecov bot commented Aug 20, 2019

Codecov Report

Merging #1747 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1747      +/-   ##
==========================================
+ Coverage   98.35%   98.35%   +<.01%     
==========================================
  Files         194      194              
  Lines        9527     9531       +4     
==========================================
+ Hits         9370     9374       +4     
  Misses        123      123              
  Partials       34       34
Impacted Files Coverage Δ
cmd/collector/app/zipkin/protov2.go 96.89% <100%> (-0.27%) ⬇️
model/ids.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4150cc...15d4b48. Read the comment docs.

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

thanks for the follow-up

return TraceID{}, fmt.Errorf("invalid length for TraceID")
}
return t, nil
}
Copy link
Member

Choose a reason for hiding this comment

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

Since we're adding a new function, I would prefer to reuse it from Unmarshal(data []byte), e.g.

func (t *TraceID) Unmarshal(data []byte) error {
    var err error
    *t, err = TraceIDFromBytes(data)
    return err
}

Similar for Unmarshal on SpanID

Copy link
Contributor Author

@jan25 jan25 Aug 21, 2019

Choose a reason for hiding this comment

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

Done. And this change would let func (t *TraceID) Unmarshal parse 8byte long TraceID(Higher 8bytes will be 0)

model/ids.go Show resolved Hide resolved
Signed-off-by: Abhilash Gnan <[email protected]>
@yurishkuro yurishkuro merged commit 0ef9a02 into jaegertracing:master Aug 21, 2019
@jan25 jan25 deleted the refactor-id branch August 21, 2019 18:06
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