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
16ea511a
Commit
16ea511a
authored
Apr 16, 2018
by
Liuhaoyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sample application
parent
886300ad
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
338 additions
and
0 deletions
+338
-0
ValuesController.cs
...SkyWalking.Sample.Backend/Controllers/ValuesController.cs
+46
-0
Program.cs
sample/SkyWalking.Sample.Backend/Program.cs
+26
-0
SkyWalking.Sample.Backend.csproj
...kyWalking.Sample.Backend/SkyWalking.Sample.Backend.csproj
+17
-0
Startup.cs
sample/SkyWalking.Sample.Backend/Startup.cs
+47
-0
appsettings.Development.json
...le/SkyWalking.Sample.Backend/appsettings.Development.json
+10
-0
appsettings.json
sample/SkyWalking.Sample.Backend/appsettings.json
+15
-0
ValuesController.cs
...kyWalking.Sample.Frontend/Controllers/ValuesController.cs
+46
-0
Program.cs
sample/SkyWalking.Sample.Frontend/Program.cs
+26
-0
SkyWalking.Sample.Frontend.csproj
...Walking.Sample.Frontend/SkyWalking.Sample.Frontend.csproj
+17
-0
Startup.cs
sample/SkyWalking.Sample.Frontend/Startup.cs
+47
-0
appsettings.Development.json
...e/SkyWalking.Sample.Frontend/appsettings.Development.json
+10
-0
appsettings.json
sample/SkyWalking.Sample.Frontend/appsettings.json
+15
-0
skywalking-csharp.sln
skywalking-csharp.sln
+16
-0
No files found.
sample/SkyWalking.Sample.Backend/Controllers/ValuesController.cs
0 → 100644
View file @
16ea511a
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Net.Http
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Mvc
;
namespace
SkyWalking.Sample.Backend.Controllers
{
[
Route
(
"api/[controller]"
)]
public
class
ValuesController
:
Controller
{
// GET api/values
[
HttpGet
]
public
IEnumerable
<
string
>
Get
()
{
return
new
string
[]
{
"value1"
,
"value2"
};
}
// GET api/values/5
[
HttpGet
(
"{id}"
)]
public
async
Task
<
string
>
Get
(
int
id
,
[
FromServices
]
IHttpClientFactory
httpClientFactory
)
{
var
httpClient
=
httpClientFactory
.
CreateClient
(
"tracing"
);
return
await
httpClient
.
GetStringAsync
(
"http://www.baidu.com"
);
}
// POST api/values
[
HttpPost
]
public
void
Post
([
FromBody
]
string
value
)
{
}
// PUT api/values/5
[
HttpPut
(
"{id}"
)]
public
void
Put
(
int
id
,
[
FromBody
]
string
value
)
{
}
// DELETE api/values/5
[
HttpDelete
(
"{id}"
)]
public
void
Delete
(
int
id
)
{
}
}
}
\ No newline at end of file
sample/SkyWalking.Sample.Backend/Program.cs
0 → 100644
View file @
16ea511a
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Logging
;
namespace
SkyWalking.Sample.Backend
{
public
class
Program
{
public
static
void
Main
(
string
[]
args
)
{
BuildWebHost
(
args
).
Run
();
}
public
static
IWebHost
BuildWebHost
(
string
[]
args
)
=>
WebHost
.
CreateDefaultBuilder
(
args
)
.
UseStartup
<
Startup
>()
.
UseUrls
(
"http://*:5002"
)
.
Build
();
}
}
\ No newline at end of file
sample/SkyWalking.Sample.Backend/SkyWalking.Sample.Backend.csproj
0 → 100644
View file @
16ea511a
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\SkyWalking.AspNetCore\SkyWalking.AspNetCore.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
sample/SkyWalking.Sample.Backend/Startup.cs
0 → 100644
View file @
16ea511a
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
SkyWalking.AspNetCore
;
namespace
SkyWalking.Sample.Backend
{
public
class
Startup
{
public
Startup
(
IConfiguration
configuration
)
{
Configuration
=
configuration
;
}
public
IConfiguration
Configuration
{
get
;
}
// This method gets called by the runtime. Use this method to add services to the container.
public
void
ConfigureServices
(
IServiceCollection
services
)
{
services
.
AddMvc
();
services
.
AddSkyWalking
(
option
=>
{
option
.
DirectServers
=
"localhost:11800"
;
option
.
ApplicationCode
=
"asp-net-core-backend"
;
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public
void
Configure
(
IApplicationBuilder
app
,
IHostingEnvironment
env
)
{
if
(
env
.
IsDevelopment
())
{
app
.
UseDeveloperExceptionPage
();
}
app
.
UseMvc
();
}
}
}
\ No newline at end of file
sample/SkyWalking.Sample.Backend/appsettings.Development.json
0 → 100644
View file @
16ea511a
{
"Logging"
:
{
"IncludeScopes"
:
false
,
"LogLevel"
:
{
"Default"
:
"Debug"
,
"System"
:
"Information"
,
"Microsoft"
:
"Information"
}
}
}
sample/SkyWalking.Sample.Backend/appsettings.json
0 → 100644
View file @
16ea511a
{
"Logging"
:
{
"IncludeScopes"
:
false
,
"Debug"
:
{
"LogLevel"
:
{
"Default"
:
"Warning"
}
},
"Console"
:
{
"LogLevel"
:
{
"Default"
:
"Warning"
}
}
}
}
sample/SkyWalking.Sample.Frontend/Controllers/ValuesController.cs
0 → 100644
View file @
16ea511a
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Mvc
;
using
SkyWalking.AspNetCore
;
namespace
SkyWalking.Sample.Frontend.Controllers
{
[
Route
(
"api/[controller]"
)]
public
class
ValuesController
:
Controller
{
// GET api/values
[
HttpGet
]
public
async
Task
<
IEnumerable
<
string
>>
Get
([
FromServices
]
TracingHttpClient
httpClient
)
{
await
httpClient
.
HttpClient
.
GetAsync
(
"http://localhost:5002/api/values"
);
return
new
string
[]
{
"value1"
,
"value2"
};
}
// GET api/values/5
[
HttpGet
(
"{id}"
)]
public
string
Get
(
int
id
)
{
return
"value"
;
}
// POST api/values
[
HttpPost
]
public
void
Post
([
FromBody
]
string
value
)
{
}
// PUT api/values/5
[
HttpPut
(
"{id}"
)]
public
void
Put
(
int
id
,
[
FromBody
]
string
value
)
{
}
// DELETE api/values/5
[
HttpDelete
(
"{id}"
)]
public
void
Delete
(
int
id
)
{
}
}
}
\ No newline at end of file
sample/SkyWalking.Sample.Frontend/Program.cs
0 → 100644
View file @
16ea511a
using
System
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.Logging
;
namespace
SkyWalking.Sample.Frontend
{
public
class
Program
{
public
static
void
Main
(
string
[]
args
)
{
BuildWebHost
(
args
).
Run
();
}
public
static
IWebHost
BuildWebHost
(
string
[]
args
)
=>
WebHost
.
CreateDefaultBuilder
(
args
)
.
UseStartup
<
Startup
>()
.
UseUrls
(
"http://*:5001"
)
.
Build
();
}
}
\ No newline at end of file
sample/SkyWalking.Sample.Frontend/SkyWalking.Sample.Frontend.csproj
0 → 100644
View file @
16ea511a
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\SkyWalking.AspNetCore\SkyWalking.AspNetCore.csproj" />
</ItemGroup>
</Project>
\ No newline at end of file
sample/SkyWalking.Sample.Frontend/Startup.cs
0 → 100644
View file @
16ea511a
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
SkyWalking.AspNetCore
;
namespace
SkyWalking.Sample.Frontend
{
public
class
Startup
{
public
Startup
(
IConfiguration
configuration
)
{
Configuration
=
configuration
;
}
public
IConfiguration
Configuration
{
get
;
}
// This method gets called by the runtime. Use this method to add services to the container.
public
void
ConfigureServices
(
IServiceCollection
services
)
{
services
.
AddMvc
();
services
.
AddSkyWalking
(
option
=>
{
option
.
DirectServers
=
"localhost:11800"
;
option
.
ApplicationCode
=
"asp-net-core-frontend"
;
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public
void
Configure
(
IApplicationBuilder
app
,
IHostingEnvironment
env
)
{
if
(
env
.
IsDevelopment
())
{
app
.
UseDeveloperExceptionPage
();
}
app
.
UseMvc
();
}
}
}
\ No newline at end of file
sample/SkyWalking.Sample.Frontend/appsettings.Development.json
0 → 100644
View file @
16ea511a
{
"Logging"
:
{
"IncludeScopes"
:
false
,
"LogLevel"
:
{
"Default"
:
"Debug"
,
"System"
:
"Information"
,
"Microsoft"
:
"Information"
}
}
}
sample/SkyWalking.Sample.Frontend/appsettings.json
0 → 100644
View file @
16ea511a
{
"Logging"
:
{
"IncludeScopes"
:
false
,
"Debug"
:
{
"LogLevel"
:
{
"Default"
:
"Warning"
}
},
"Console"
:
{
"LogLevel"
:
{
"Default"
:
"Warning"
}
}
}
}
skywalking-csharp.sln
View file @
16ea511a
...
...
@@ -30,6 +30,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{CBFF7EE0-6
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.AspNetCore", "src\SkyWalking.AspNetCore\SkyWalking.AspNetCore.csproj", "{D75B68C5-6788-4871-A63F-F6EB48FB0DC5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{844CEACD-4C85-4B15-9E2B-892B01FDA4BB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Sample.Backend", "sample\SkyWalking.Sample.Backend\SkyWalking.Sample.Backend.csproj", "{80A67B09-83F2-477F-907F-95FFF5B8FEAF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkyWalking.Sample.Frontend", "sample\SkyWalking.Sample.Frontend\SkyWalking.Sample.Frontend.csproj", "{2B4E350E-A1E5-4B4A-A642-BCA6D3887E5A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
...
...
@@ -60,6 +66,14 @@ Global
{D75B68C5-6788-4871-A63F-F6EB48FB0DC5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D75B68C5-6788-4871-A63F-F6EB48FB0DC5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D75B68C5-6788-4871-A63F-F6EB48FB0DC5}.Release|Any CPU.Build.0 = Release|Any CPU
{80A67B09-83F2-477F-907F-95FFF5B8FEAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80A67B09-83F2-477F-907F-95FFF5B8FEAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80A67B09-83F2-477F-907F-95FFF5B8FEAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80A67B09-83F2-477F-907F-95FFF5B8FEAF}.Release|Any CPU.Build.0 = Release|Any CPU
{2B4E350E-A1E5-4B4A-A642-BCA6D3887E5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B4E350E-A1E5-4B4A-A642-BCA6D3887E5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B4E350E-A1E5-4B4A-A642-BCA6D3887E5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B4E350E-A1E5-4B4A-A642-BCA6D3887E5A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
@@ -73,6 +87,8 @@ Global
{54B9183A-928B-43E1-9851-10E2F1CCE61C} = {CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}
{50BE8184-EC7A-4257-AF54-764C0E61276F} = {CBFF7EE0-69D7-4D6A-9BBD-8E567FF4D810}
{D75B68C5-6788-4871-A63F-F6EB48FB0DC5} = {79ED86A5-E9B9-49B2-9354-C911C079D03E}
{80A67B09-83F2-477F-907F-95FFF5B8FEAF} = {844CEACD-4C85-4B15-9E2B-892B01FDA4BB}
{2B4E350E-A1E5-4B4A-A642-BCA6D3887E5A} = {844CEACD-4C85-4B15-9E2B-892B01FDA4BB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {94C0DA2C-CCCB-4314-93A2-9809B5DD0583}
...
...
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