Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
8315932f
Commit
8315932f
authored
Apr 07, 2018
by
Liuhaoyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor ContextCarrier
parent
546931b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
21 deletions
+48
-21
IContextCarrier.cs
src/SkyWalking.Abstractions/Context/IContextCarrier.cs
+6
-0
ContextCarrier.cs
src/SkyWalking.Core/Context/ContextCarrier.cs
+42
-21
No files found.
src/SkyWalking.Abstractions/Context/IContextCarrier.cs
View file @
8315932f
...
...
@@ -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
;
}
...
...
src/SkyWalking.Core/Context/ContextCarrier.cs
View file @
8315932f
...
...
@@ -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
(
_parentO
P
erationName
)
&&
string
.
IsNullOrEmpty
(
_parentO
p
erationName
)
&&
string
.
IsNullOrEmpty
(
_entryOperationName
)
&&
_primaryDistributedTraceId
!=
null
;
}
...
...
@@ -133,7 +154,7 @@ namespace SkyWalking.Context
_entryApplicationInstanceId
=
int
.
Parse
(
parts
[
3
]);
_peerHost
=
parts
[
4
];
_entryOperationName
=
parts
[
5
];
_parentO
P
erationName
=
parts
[
6
];
_parentO
p
erationName
=
parts
[
6
];
_primaryDistributedTraceId
=
new
PropagatedTraceId
(
parts
[
7
]);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment