wu-sheng commented on a change in pull request #10: used the nginx lua code
style.
URL:
https://github.com/apache/skywalking-nginx-lua/pull/10#discussion_r386033285
##########
File path: lib/skywalking/tracing_context_test.lua
##########
@@ -30,24 +31,24 @@ TestTracingContext = {}
end
function TestTracingContext:testInternal_NextSpanSeqID()
- local context = TC:new(1, 1)
+ local context = TC.new(1, 1)
- lu.assertEquals(context.internal:nextSpanID(), 0)
+ lu.assertEquals(TC_Internal.nextSpanID(context.internal), 0)
end
function TestTracingContext:testInternal_addActive()
- local context = TC:new(1, 1)
+ local context = TC.new(1, 1)
local mockSpan = {span_id = 0}
- context.internal:addActive(mockSpan)
+ TC_Internal.addActive(context.internal, mockSpan)
- lu.assertEquals(#(context.internal.active_spans), 1)
+ lu.assertEquals(#context.internal.active_spans, 1)
end
function TestTracingContext:testSpanStack()
- local context = TC:new(1, 1)
- local span1 = context:createEntrySpan('entry_op')
- local span2 = context:createExitSpan("exit_op", span1, "127.0.0.1")
+ local context = TC.new(1, 1)
+ local span1 = TC.createEntrySpan(context, 'entry_op')
+ local span2 = TC.createExitSpan(context, "exit_op", span1, "127.0.0.1")
Review comment:
Why use this code style? In the tracing concept, there should be one
context, which hosts all inform to connect spans.
I put the codes in the old way in order to keep the internal context in the
shadow, and open limited APIs.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services