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
54b7c0b9
Commit
54b7c0b9
authored
Apr 09, 2018
by
Liuhaoyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor ContextSnapshot
parent
83c1f584
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
38 deletions
+20
-38
ContextSnapshot.cs
src/SkyWalking.Core/Context/ContextSnapshot.cs
+20
-38
No files found.
src/SkyWalking.Core/Context/ContextSnapshot.cs
View file @
54b7c0b9
...
@@ -28,12 +28,12 @@ namespace SkyWalking.Context
...
@@ -28,12 +28,12 @@ namespace SkyWalking.Context
/// <summary>
/// <summary>
/// Trace Segment Id of the parent trace segment
/// Trace Segment Id of the parent trace segment
/// </summary>
/// </summary>
private
ID
_traceSegmentId
;
private
readonly
ID
_traceSegmentId
;
/// <summary>
/// <summary>
/// span id of the parent span , in parent trace segment
/// span id of the parent span , in parent trace segment
/// </summary>
/// </summary>
private
int
_spanId
=
-
1
;
private
readonly
int
_spanId
=
-
1
;
private
string
_entryOperationName
;
private
string
_entryOperationName
;
private
string
_parentOperationName
;
private
string
_parentOperationName
;
...
@@ -51,63 +51,45 @@ namespace SkyWalking.Context
...
@@ -51,63 +51,45 @@ namespace SkyWalking.Context
public
string
EntryOperationName
public
string
EntryOperationName
{
{
get
{
return
_entryOperationName
;
}
get
=>
_entryOperationName
;
set
{
_entryOperationName
=
"#"
+
value
;
}
set
=>
_entryOperationName
=
"#"
+
value
;
}
}
public
string
ParentOperationName
public
string
ParentOperationName
{
{
get
{
return
_parentOperationName
;
}
get
=>
_parentOperationName
;
set
{
_parentOperationName
=
"#"
+
value
;
}
set
=>
_parentOperationName
=
"#"
+
value
;
}
}
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
int
SpanId
public
int
SpanId
=>
_spanId
;
{
get
{
return
_spanId
;
}
}
public
bool
IsFromCurrent
public
bool
IsFromCurrent
=>
_traceSegmentId
.
Equals
(
ContextManager
.
Capture
.
TraceSegmentId
);
{
get
{
return
_traceSegmentId
.
Equals
(
ContextManager
.
Capture
().
TraceSegmentId
);
}
}
public
bool
IsValid
public
bool
IsValid
=>
_traceSegmentId
!=
null
{
&&
_spanId
>
-
1
get
&&
_entryApplicationInstanceId
!=
DictionaryUtil
.
NullValue
{
&&
_primaryDistributedTraceId
!=
null
return
_traceSegmentId
!=
null
&&
string
.
IsNullOrEmpty
(
_entryOperationName
)
&&
_spanId
>
-
1
&&
string
.
IsNullOrEmpty
(
_parentOperationName
);
&&
_entryApplicationInstanceId
!=
DictionaryUtil
.
NullValue
&&
_primaryDistributedTraceId
!=
null
&&
string
.
IsNullOrEmpty
(
_entryOperationName
)
&&
string
.
IsNullOrEmpty
(
_parentOperationName
);
}
}
public
ID
TraceSegmentId
public
ID
TraceSegmentId
=>
_traceSegmentId
;
{
get
{
return
_traceSegmentId
;
}
}
public
int
EntryOperationId
public
int
EntryOperationId
{
{
set
{
_entryOperationName
=
value
+
""
;
}
set
=>
_entryOperationName
=
value
+
""
;
}
}
public
int
ParentOperationId
public
int
ParentOperationId
{
{
set
{
_parentOperationName
=
value
+
""
;
}
set
=>
_parentOperationName
=
value
+
""
;
}
}
}
}
}
}
\ No newline at end of file
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