Commit 8315932f authored by Liuhaoyang's avatar Liuhaoyang

Refactor ContextCarrier

parent 546931b1
......@@ -29,12 +29,18 @@ namespace SkyWalking.Context
int EntryApplicationInstanceId { get; set; }
string EntryOperationName { get; set; }
int EntryOperationId { get; set; }
int ParentApplicationInstanceId { get; set; }
string ParentOperationName { get; set; }
int ParentOperationId { get; set; }
string PeerHost { get; set; }
int PeerId { get; set; }
int SpanId { get; set; }
......
......@@ -47,64 +47,85 @@ namespace SkyWalking.Context
/// </summary>
private string _peerHost;
private int _peerId;
/// <summary>
/// Operation/Service name of the first one in this distributed trace .
/// </summary>
private string _entryOperationName;
private int _entryOperationId;
/// <summary>
/// Operation/Service name of the parent one in this distributed trace .
/// </summary>
private string _parentOPerationName;
private string _parentOperationName;
private int _parentOperationId;
private DistributedTraceId _primaryDistributedTraceId;
public DistributedTraceId DistributedTraceId
{
get { return _primaryDistributedTraceId; }
}
public DistributedTraceId DistributedTraceId => _primaryDistributedTraceId;
public int EntryApplicationInstanceId
{
get { return _entryApplicationInstanceId; }
set { _entryApplicationInstanceId = value; }
get => _entryApplicationInstanceId;
set => _entryApplicationInstanceId = value;
}
public string EntryOperationName
{
get { return _entryOperationName; }
set { _entryOperationName = "#" + value; }
get => _entryOperationName;
set => _entryOperationName = "#" + value;
}
public int EntryOperationId
{
get => _entryOperationId;
set => _entryOperationId = value;
}
public int ParentApplicationInstanceId
{
get { return _parentApplicationInstanceId; }
set { _parentApplicationInstanceId = value; }
get => _parentApplicationInstanceId;
set => _parentApplicationInstanceId = value;
}
public string ParentOperationName
{
get { return _parentOPerationName; }
set { _parentOPerationName = "#" + value; }
get => _parentOperationName;
set => _parentOperationName = "#" + value;
}
public int ParentOperationId
{
get => _parentOperationId;
set => _parentOperationId = value;
}
public string PeerHost
{
get { return _peerHost; }
set { _peerHost = value; }
get => _peerHost;
set => _peerHost = value;
}
public int PeerId
{
get => _peerId;
set => _peerId = value;
}
public int SpanId
{
get { return _spanId; }
set { _spanId = value; }
get => _spanId;
set => _spanId = value;
}
public ID TraceSegmentId
{
get { return _traceSegmentId; }
set { _traceSegmentId = value; }
get => _traceSegmentId;
set => _traceSegmentId = value;
}
public bool IsValid
......@@ -116,7 +137,7 @@ namespace SkyWalking.Context
&& _spanId > -1
&& _parentApplicationInstanceId != DictionaryUtil.NullValue
&& _entryApplicationInstanceId != DictionaryUtil.NullValue
&& string.IsNullOrEmpty(_parentOPerationName)
&& string.IsNullOrEmpty(_parentOperationName)
&& string.IsNullOrEmpty(_entryOperationName)
&& _primaryDistributedTraceId != null;
}
......@@ -133,7 +154,7 @@ namespace SkyWalking.Context
_entryApplicationInstanceId = int.Parse(parts[3]);
_peerHost = parts[4];
_entryOperationName = parts[5];
_parentOPerationName = parts[6];
_parentOperationName = parts[6];
_primaryDistributedTraceId = new PropagatedTraceId(parts[7]);
}
......
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