Closed jcchavezs closed 6 years ago
Why is it named mock tracer? it doesnt really mock or? it really works.
Basically following the naming from other language's libraries. The main advantage of this tracer is that it is inspectable, you can access to all the attributes of a span.
@jcchavezs ok that makes sense then.
A few subjective technical nitpickeries:
I would prefer a namespace OpenTracking\MockTracer
instead of OpenTracingMock
. The first namespace is usually the vendor and adding another namespace entry to the composer list has a small perf penalty for something that nobody will use in their production code.
Naming the classes Span
and implenents OTSpan
with use statement rename is a bad practice imho, because it creates a second item in PHPStorm called Span
and people sometimes make mistakes importing the wrong ones. If the class would be called MockSpan
this wouldn't happen.
you mentioned this is needed for testing, but you have added no tests using the mock tracer, is this intentional and only needed for #45 after merge?
Otherwise +1
Thanks for the great feedback, Ben.
OpenTracing\MockTracer
namespace but I think the current setup having OpenTracingMock
in require-dev
avoid the performance penalty. Am I missing something?OpenTracing\MockTracer\MockSpan
looks too much mock
. Is there any other approach we could sort this out by?WIP
in the title so it is clear.Again, great feedback!
@jcchavezs you are right about require-dev
, sorry i didnt see that.
I don't agree with "too much mock", you must see it in context of being use'd
once at the top so one "Mock" in the namespace name is already not visible anymore. and then if you are using Span
in your testcode, its not clear if its the interface or the mock span. From a user perspective of this class i prefer to be clearer.
@jcchavezs But if you leave this under autoload-dev
other libraries that require this package and want to use those mocks on their test suite will not be able to do so as they will not be autoloadable from their point of view. Or that is not a goal of those mocks?
Right @ellisv I will change that.
I just uploaded all the code and removed the wip tag. Please have a look.
Ping @beberlei @StymiedSloth @masterada @ellisv @yurishkuro
Please final review @beberlei @StymiedSloth @masterada @ellisv @yurishkuro
Short description of what this PR does:
readme.md
are more than welcome.Checklist
Ping @yurishkuro @tedsuo @felixfbecker @beberlei
Closes #21