-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add README for dotnet examples (#233)
* Add README for dotnet examples * Remove examples for .NET Core 3.1
- Loading branch information
1 parent
9c89c4b
commit 261f882
Showing
17 changed files
with
39 additions
and
137 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,39 @@ | ||
# .NET Examples | ||
|
||
The directory contains examples of how to run Pyroscop to profile .NET applications in Docker containers. | ||
|
||
### Fast-slow | ||
|
||
The example is a simple single-thread application similar to examples for other spies. | ||
|
||
The code is pretty self-explanatory: `Slow.Work` should take 80% of CPU time and remaining 20% to be consumed by | ||
`Fast.Work`. You may ask why `Fast` and `Slow` classes are defined in separate namespaces. The fact is that Pyroscope | ||
colors frames depending on the namespaces (for .NET traces), so they are defined in this way just for sake of demo ;) | ||
|
||
In this example, the program is built as an executable (`/dotnet/example`), therefore `-spy-name dotnetspy` argument is | ||
required to tell Pyroscope how to deal with the process: | ||
> CMD ["pyroscope", "exec", "-spy-name", "dotnetspy", "/dotnet/example"] | ||
To run the example execute the following commands: | ||
|
||
```shell | ||
# cd examples/dotnet/fast-slow | ||
# docker-compose up | ||
``` | ||
|
||
### Web | ||
|
||
The example is a simple ASP.NET Core web app that enables you to observe how consumed CPU time is changed by making | ||
HTTP requests to [http://localhost:5000](http://localhost:5000). | ||
|
||
In contrast to the previous example, the application is built as a dynamic library (`/dotnet/example.dll`) and | ||
runs with dotnet. This allows Pyroscope to automatically detect which kind of spy to use, making `-spy-name` option | ||
unnecessary: | ||
> CMD ["pyroscope", "exec", "dotnet", "/dotnet/example.dll"] | ||
To run the example execute the following commands: | ||
|
||
```shell | ||
# cd examples/dotnet/web | ||
# docker-compose up | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.