-
Notifications
You must be signed in to change notification settings - Fork 571
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc5d5e7
commit 99f1149
Showing
26 changed files
with
468 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:3.1 | ||
|
||
WORKDIR /dotnet | ||
|
||
COPY --from=pyroscope/pyroscope:dev /usr/bin/pyroscope /usr/bin/pyroscope | ||
ADD example . | ||
|
||
RUN dotnet publish -o . -r linux-x64 | ||
|
||
ENV PYROSCOPE_APPLICATION_NAME=fast-slow.dotnet.app | ||
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040/ | ||
ENV PYROSCOPE_LOG_LEVEL=debug | ||
CMD ["pyroscope", "exec", "-spy-name", "dotnetspy", "/dotnet/example"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
version: "3.9" | ||
services: | ||
pyroscope: | ||
image: "pyroscope/pyroscope:latest" | ||
ports: | ||
- "4040:4040" | ||
command: | ||
- "server" | ||
app: | ||
build: "" | ||
cap_add: | ||
- SYS_PTRACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<AssemblyName>example</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<PackageId>example</PackageId> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace Example | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
while (true) | ||
{ | ||
_ = new Fast.Work(); | ||
_ = new Slow.Work(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
namespace Slow | ||
{ | ||
public class Work | ||
{ | ||
public Work() | ||
{ | ||
var j = 0; | ||
for (var i = 0; i < 8000; i++) j++; | ||
} | ||
} | ||
} | ||
|
||
namespace Fast | ||
{ | ||
public class Work | ||
{ | ||
public Work() | ||
{ | ||
var j = 0; | ||
for (var i = 0; i < 2000; i++) j++; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:3.1 | ||
|
||
WORKDIR /dotnet | ||
|
||
COPY --from=pyroscope/pyroscope:dev /usr/bin/pyroscope /usr/bin/pyroscope | ||
ADD example . | ||
|
||
RUN dotnet publish -o . -r linux-x64 | ||
|
||
ENV PYROSCOPE_APPLICATION_NAME=web.dotnet.app | ||
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040/ | ||
ENV PYROSCOPE_LOG_LEVEL=debug | ||
CMD ["pyroscope", "exec", "dotnet", "/dotnet/example.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
version: "3.9" | ||
services: | ||
pyroscope: | ||
image: "pyroscope/pyroscope:latest" | ||
ports: | ||
- "4040:4040" | ||
command: | ||
- "server" | ||
app: | ||
environment: | ||
ASPNETCORE_URLS: http://*:5000 | ||
ports: | ||
- "5000:5000" | ||
build: "" | ||
cap_add: | ||
- SYS_PTRACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<AssemblyName>example</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<PackageId>example</PackageId> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.AspNetCore.Http; | ||
|
||
public static class Program | ||
{ | ||
public static void Main() | ||
{ | ||
WebHost.CreateDefaultBuilder() | ||
.Configure(app => | ||
{ | ||
app.UseRouting(); | ||
app.UseEndpoints(endpoints => | ||
{ | ||
endpoints.MapGet("/", async context => | ||
{ | ||
var j = 0; | ||
for (var i = 0; i < 100000000; i++) j++; | ||
await context.Response.WriteAsync("Hello!"); | ||
}); | ||
}); | ||
}) | ||
.Build() | ||
.Run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:5.0 | ||
|
||
WORKDIR /dotnet | ||
|
||
COPY --from=pyroscope/pyroscope:dev /usr/bin/pyroscope /usr/bin/pyroscope | ||
ADD example . | ||
|
||
RUN dotnet publish -o . -r linux-x64 | ||
|
||
ENV PYROSCOPE_APPLICATION_NAME=fast-slow.dotnet.app | ||
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040/ | ||
ENV PYROSCOPE_LOG_LEVEL=debug | ||
CMD ["pyroscope", "exec", "-spy-name", "dotnetspy", "/dotnet/example"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
version: "3.9" | ||
services: | ||
pyroscope: | ||
image: "pyroscope/pyroscope:latest" | ||
ports: | ||
- "4040:4040" | ||
command: | ||
- "server" | ||
app: | ||
build: "" | ||
cap_add: | ||
- SYS_PTRACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<AssemblyName>example</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<PackageId>example</PackageId> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace Example | ||
{ | ||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
while (true) | ||
{ | ||
_ = new Fast.Work(); | ||
_ = new Slow.Work(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
namespace Slow | ||
{ | ||
public class Work | ||
{ | ||
public Work() | ||
{ | ||
var j = 0; | ||
for (var i = 0; i < 8000; i++) j++; | ||
} | ||
} | ||
} | ||
|
||
namespace Fast | ||
{ | ||
public class Work | ||
{ | ||
public Work() | ||
{ | ||
var j = 0; | ||
for (var i = 0; i < 2000; i++) j++; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:5.0 | ||
|
||
WORKDIR /dotnet | ||
|
||
COPY --from=pyroscope/pyroscope:dev /usr/bin/pyroscope /usr/bin/pyroscope | ||
ADD example . | ||
|
||
RUN dotnet publish -o . -r linux-x64 | ||
|
||
ENV PYROSCOPE_APPLICATION_NAME=web.dotnet.app | ||
ENV PYROSCOPE_SERVER_ADDRESS=http://pyroscope:4040/ | ||
ENV PYROSCOPE_LOG_LEVEL=debug | ||
CMD ["pyroscope", "exec", "dotnet", "/dotnet/example.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
version: "3.9" | ||
services: | ||
pyroscope: | ||
image: "pyroscope/pyroscope:latest" | ||
ports: | ||
- "4040:4040" | ||
command: | ||
- "server" | ||
app: | ||
environment: | ||
ASPNETCORE_URLS: http://*:5000 | ||
ports: | ||
- "5000:5000" | ||
build: "" | ||
cap_add: | ||
- SYS_PTRACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
<AssemblyName>example</AssemblyName> | ||
<OutputType>Exe</OutputType> | ||
<PackageId>example</PackageId> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Microsoft.AspNetCore; | ||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Hosting; | ||
using Microsoft.AspNetCore.Http; | ||
|
||
public static class Program | ||
{ | ||
public static void Main() | ||
{ | ||
WebHost.CreateDefaultBuilder() | ||
.Configure(app => | ||
{ | ||
app.UseRouting(); | ||
app.UseEndpoints(endpoints => | ||
{ | ||
endpoints.MapGet("/", async context => | ||
{ | ||
var j = 0; | ||
for (var i = 0; i < 100000000; i++) j++; | ||
await context.Response.WriteAsync("Hello!"); | ||
}); | ||
}); | ||
}) | ||
.Build() | ||
.Run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.