Commit 8315932f authored by Liuhaoyang's avatar Liuhaoyang

Refactor ContextCarrier

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