-
Notifications
You must be signed in to change notification settings - Fork 11
fixing hexdec on a 16 char hex number, which could actually exceed INT64 #8
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
CLAs look good, thanks! |
Need to fix some things before getting back with this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this!
Feat/span converter interface
moved hexdec converter methods into their own classes having their ow…
Hi @chingor13, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! The refactoring looks good so far. Just added a few smallish things.
* This class handles converting from the OpenCensus data model into its | ||
* Jaeger Thrift representation. | ||
*/ | ||
interface SpanConverterInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this interface is needed. There's only one implementation and its internal (or probably should be) until the need arises for a separate implementation.
namespace OpenCensus\Trace\Exporter\Jaeger; | ||
|
||
/** | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fill this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
@chingor13 could you make a release for this PR? |
On a 16 'digits' hex chunck, i.e.
bea15bfc5e308b1a
,hexdec
method can trigger erros, because the converted number could exceed PHP integer side.A solution would be to create a _hexdec method using php-bc or php-gpm to convert the chunk to a decimal number, then convert the number to a 64 bit signed INT number and parse it with
intval
.This is my approach, it's not the best, so hoping you guys will refine it further :)