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
84f65569
Commit
84f65569
authored
Apr 01, 2018
by
Liuhaoyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor
parent
c295204b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
204 additions
and
4 deletions
+204
-4
IBootService.cs
src/SkyWalking.Abstractions/Boot/IBootService.cs
+29
-0
AgentConfig.cs
src/SkyWalking.Abstractions/Config/AgentConfig.cs
+50
-0
CarrierItem.cs
src/SkyWalking.Abstractions/Context/CarrierItem.cs
+9
-1
ITracerContext.cs
src/SkyWalking.Abstractions/Context/ITracerContext.cs
+19
-1
ISampler.cs
src/SkyWalking.Abstractions/Sampling/ISampler.cs
+29
-0
TracingContext.cs
src/SkyWalking.Core/Context/TracingContext.cs
+68
-2
No files found.
src/SkyWalking.Abstractions/Boot/IBootService.cs
0 → 100644
View file @
84f65569
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using
System.Threading.Tasks
;
namespace
SkyWalking.Boot
{
public
interface
IBootService
{
Task
Executing
();
Task
Executed
();
}
}
\ No newline at end of file
src/SkyWalking.Abstractions/Config/AgentConfig.cs
0 → 100644
View file @
84f65569
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
namespace
SkyWalking.Config
{
public
static
class
AgentConfig
{
/// <summary>
/// Namespace isolates headers in cross propagation. The HEADER name will be 'HeaderName:Namespace'.
/// </summary>
public
static
string
Namespace
{
get
;
set
;
}
/// <summary>
/// Application code is showed in sky-walking-ui
/// </summary>
public
static
string
ApplicationCode
{
get
;
set
;
}
/// <summary>
/// Negative or zeor means off ,by default. Sample_N_Per_3_Secs means sampling N TraceSegment in 10 seconds tops.
/// </summary>
public
static
int
Sample_N_Per_3_Secs
=
-
1
;
/// <summary>
/// If the operation name of the first span is included in this set, this segment should be ignored.
/// </summary>
public
static
string
IgnoreSuffix
=
".jpg,.jpeg,.js,.css,.png,.bmp,.gif,.ico,.mp3,.mp4,.html,.svg"
;
/// <summary>
/// The max number of spans in a single segment. Through this config item, skywalking keep your application memory cost estimated.
/// </summary>
public
static
int
SpanLimitPerSegment
=
300
;
}
}
\ No newline at end of file
src/SkyWalking.Abstractions/Context/CarrierItem.cs
View file @
84f65569
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
using
System
;
using
System
;
using
System.Collections
;
using
System.Collections
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
SkyWalking.Config
;
namespace
SkyWalking.Context
namespace
SkyWalking.Context
{
{
...
@@ -57,7 +58,14 @@ namespace SkyWalking.Context
...
@@ -57,7 +58,14 @@ namespace SkyWalking.Context
public
CarrierItem
(
String
headKey
,
String
headValue
,
CarrierItem
next
)
public
CarrierItem
(
String
headKey
,
String
headValue
,
CarrierItem
next
)
{
{
_headKey
=
headKey
;
if
(
string
.
IsNullOrEmpty
(
AgentConfig
.
Namespace
))
{
_headKey
=
headKey
;
}
else
{
_headKey
=
$"
{
AgentConfig
.
Namespace
}
:
{
headKey
}
"
;
}
_headValue
=
headValue
;
_headValue
=
headValue
;
_next
=
next
;
_next
=
next
;
}
}
...
...
src/SkyWalking.Abstractions/Context/ITracerContext.cs
View file @
84f65569
...
@@ -16,12 +16,30 @@
...
@@ -16,12 +16,30 @@
*
*
*/
*/
using
S
ystem
;
using
S
kyWalking.Context.Trace
;
namespace
SkyWalking.Context
namespace
SkyWalking.Context
{
{
public
interface
ITracerContext
public
interface
ITracerContext
{
{
void
Inject
(
IContextCarrier
carrier
);
void
Extract
(
IContextCarrier
carrier
);
IContextSnapshot
Capture
{
get
;
}
ISpan
ActiveSpan
{
get
;
}
void
Continued
(
IContextSnapshot
snapshot
);
string
GetReadableGlobalTraceId
();
ISpan
CreateEntrySpan
(
string
operationName
);
ISpan
CreateLocalSpan
(
string
operationName
);
ISpan
CreateExitSpan
(
string
operationName
,
string
remotePeer
);
void
StopSpan
(
ISpan
span
);
}
}
}
}
src/SkyWalking.Abstractions/Sampling/ISampler.cs
0 → 100644
View file @
84f65569
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using
SkyWalking.Boot
;
namespace
SkyWalking.Sampling
{
public
interface
ISampler
:
IBootService
{
bool
TrySampling
();
void
ForceSampled
();
}
}
\ No newline at end of file
src/SkyWalking.Core/Context/TracingContext.cs
View file @
84f65569
namespace
SkyWalking.Context
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using
SkyWalking.Context.Trace
;
namespace
SkyWalking.Context
{
{
public
class
TracingContext
public
class
TracingContext
:
ITracerContext
{
{
private
long
_lastWarningTimestamp
=
0
;
public
void
Inject
(
IContextCarrier
carrier
)
{
throw
new
System
.
NotImplementedException
();
}
public
void
Extract
(
IContextCarrier
carrier
)
{
throw
new
System
.
NotImplementedException
();
}
public
IContextSnapshot
Capture
{
get
;
}
public
ISpan
ActiveSpan
{
get
;
}
public
void
Continued
(
IContextSnapshot
snapshot
)
{
throw
new
System
.
NotImplementedException
();
}
public
string
GetReadableGlobalTraceId
()
{
throw
new
System
.
NotImplementedException
();
}
public
ISpan
CreateEntrySpan
(
string
operationName
)
{
throw
new
System
.
NotImplementedException
();
}
public
ISpan
CreateLocalSpan
(
string
operationName
)
{
throw
new
System
.
NotImplementedException
();
}
public
ISpan
CreateExitSpan
(
string
operationName
,
string
remotePeer
)
{
throw
new
System
.
NotImplementedException
();
}
public
void
StopSpan
(
ISpan
span
)
{
throw
new
System
.
NotImplementedException
();
}
}
}
}
}
\ 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