Commit 83c1f584 authored by Liuhaoyang's avatar Liuhaoyang

Init TracingContext

parent 3fc84f15
...@@ -27,16 +27,34 @@ namespace SkyWalking.Context.Trace ...@@ -27,16 +27,34 @@ namespace SkyWalking.Context.Trace
{ {
public class ExitSpan : StackBasedTracingSpan, IWithPeerInfo public class ExitSpan : StackBasedTracingSpan, IWithPeerInfo
{ {
private string _peer; private readonly string _peer;
private int _peerId; private readonly int _peerId;
protected ExitSpan(int spanId, int parentSpanId, string operationName,string peer) : base(spanId, parentSpanId, operationName) public ExitSpan(int spanId, int parentSpanId, String operationName, String peer)
: base(spanId, parentSpanId, operationName)
{ {
_peer = peer; _peer = peer;
_peerId = DictionaryUtil.NullValue;
} }
protected ExitSpan(int spanId, int parentSpanId, int operationId,int peerId) : base(spanId, parentSpanId, operationId) public ExitSpan(int spanId, int parentSpanId, int operationId, int peerId)
: base(spanId, parentSpanId, operationId)
{ {
_peer = null;
_peerId = peerId;
}
public ExitSpan(int spanId, int parentSpanId, int operationId, String peer)
: base(spanId, parentSpanId, operationId)
{
_peer = peer;
_peerId = DictionaryUtil.NullValue;
}
public ExitSpan(int spanId, int parentSpanId, String operationName, int peerId)
: base(spanId, parentSpanId, operationName)
{
_peer = null;
_peerId = peerId; _peerId = peerId;
} }
...@@ -54,6 +72,7 @@ namespace SkyWalking.Context.Trace ...@@ -54,6 +72,7 @@ namespace SkyWalking.Context.Trace
{ {
base.Start(); base.Start();
} }
return base.Start(); return base.Start();
} }
...@@ -63,6 +82,7 @@ namespace SkyWalking.Context.Trace ...@@ -63,6 +82,7 @@ namespace SkyWalking.Context.Trace
{ {
base.Tag(key, value); base.Tag(key, value);
} }
return this; return this;
} }
...@@ -72,6 +92,7 @@ namespace SkyWalking.Context.Trace ...@@ -72,6 +92,7 @@ namespace SkyWalking.Context.Trace
{ {
return base.SetLayer(layer); return base.SetLayer(layer);
} }
return this; return this;
} }
...@@ -81,6 +102,7 @@ namespace SkyWalking.Context.Trace ...@@ -81,6 +102,7 @@ namespace SkyWalking.Context.Trace
{ {
return base.SetComponent(component); return base.SetComponent(component);
} }
return this; return this;
} }
...@@ -90,15 +112,13 @@ namespace SkyWalking.Context.Trace ...@@ -90,15 +112,13 @@ namespace SkyWalking.Context.Trace
{ {
return base.SetComponent(componentName); return base.SetComponent(componentName);
} }
return this; return this;
} }
public override string OperationName public override string OperationName
{ {
get get { return base.OperationName; }
{
return base.OperationName;
}
set set
{ {
if (_stackDepth == 1) if (_stackDepth == 1)
...@@ -110,10 +130,7 @@ namespace SkyWalking.Context.Trace ...@@ -110,10 +130,7 @@ namespace SkyWalking.Context.Trace
public override int OperationId public override int OperationId
{ {
get get { return base.OperationId; }
{
return base.OperationId;
}
set set
{ {
if (_stackDepth == 1) if (_stackDepth == 1)
...@@ -125,7 +142,7 @@ namespace SkyWalking.Context.Trace ...@@ -125,7 +142,7 @@ namespace SkyWalking.Context.Trace
public override SpanObject Transform() public override SpanObject Transform()
{ {
var spanObject= base.Transform(); var spanObject = base.Transform();
if (_peerId != DictionaryUtil.NullValue) if (_peerId != DictionaryUtil.NullValue)
{ {
......
...@@ -21,11 +21,11 @@ namespace SkyWalking.Context.Trace ...@@ -21,11 +21,11 @@ namespace SkyWalking.Context.Trace
{ {
public class LocalSpan : StackBasedTracingSpan public class LocalSpan : StackBasedTracingSpan
{ {
protected LocalSpan(int spanId, int parentSpanId, string operationName) : base(spanId, parentSpanId, operationName) public LocalSpan(int spanId, int parentSpanId, string operationName) : base(spanId, parentSpanId, operationName)
{ {
} }
protected LocalSpan(int spanId, int parentSpanId, int operationId) : base(spanId, parentSpanId, operationId) public LocalSpan(int spanId, int parentSpanId, int operationId) : base(spanId, parentSpanId, operationId)
{ {
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment