Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teddymacn/CoreProfiler
A .NET Core Profiling Library
https://github.com/teddymacn/CoreProfiler
Last synced: 3 months ago
JSON representation
A .NET Core Profiling Library
- Host: GitHub
- URL: https://github.com/teddymacn/CoreProfiler
- Owner: teddymacn
- License: mit
- Created: 2016-05-03T08:32:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-15T07:35:45.000Z (over 6 years ago)
- Last Synced: 2024-08-03T19:48:46.163Z (3 months ago)
- Language: C#
- Size: 3.48 MB
- Stars: 62
- Watchers: 2
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-dotnet - CoreProfiler - A .NET Core Profiling Library (Libraries, Frameworks and Tools / Profiling)
README
CoreProfiler
============CoreProfiler is a light weight performance profiling library for .NET Core. (Supports .Net Core 2.0 since v1.1)
CoreProfiler is a port of [NanoProfiler](https://github.com/englishtown/nanoprofiler) by the same author of NanoProfiler.
The same as NanoProfiler, for web application, CoreProfiler provides a wonderful view-result Web UI supports view latest profiling results in a tree-timeline view (simply visit ~/coreprofiler/view in your web application).
For documentations of NanoProfiler, please check out wiki pages: https://github.com/englishtown/nanoprofiler/wiki
How to compile the source code?
-------------------------------- Download latest version of dotnet cli from [https://github.com/dotnet/cli](https://github.com/dotnet/cli)
- git clone https://github.com/teddymacn/CoreProfiler.git
- Run .\build.ps1License terms
-------------
CoreProfiler is released under the [MIT license](https://mit-license.org/).Basic usage
------------ For profiling a web applications, you need to add references to both CoreProfiler and CoreProfiler.Web packages.
- For profiling a console or web application which call wcf services, please also reference Console.Wcf package.
To enable wcf profiling in a .net core project, you need to implement the partial method below for each of your wcf client:
``` csharp
static partial void ConfigureEndpoint(ServiceEndpoint serviceEndpoint, ClientCredentials clientCredentials)
{
serviceEndpoint.EndpointBehaviors.Add(new WcfProfilingBehavior());
}
```- In the Startup.cs file, you need to add the code below as the first app.UseXXX() pipeline to enable CoreProfiler profiling:
app.UseCoreProfiler(drillDown:true); //if drillDown=true, try to drill down child requests from external apps when view profiling results
- Add a [coreprofiler.json](https://github.com/teddymacn/CoreProfiler/blob/master/mvc-ef-demo/coreprofiler.json) file to your project and make sure it is copied to the output.
- If you want to profile DB queries, you need to wrap DbConnection instances like for example: [here](https://github.com/teddymacn/CoreProfiler/blob/master/mvc-ef-demo/Startup.cs).
- In the coreprofiler.json file, you could configure some options of the profiling, including specifying custom configuration provider, log provider and persistence storage for persisting, profiling filters, number of profiling results to be kept in memory for display, etc.
You can check the [mvc-ef-demo](https://github.com/teddymacn/CoreProfiler/tree/master/mvc-ef-demo) sample for how to enable profiling in a mvc + entityframeworkcore web application.
You can check the [console-demo](https://github.com/teddymacn/CoreProfiler/blob/master/console-demo) sample for how to use JsonProfilingStorage to persist logs and [how to start/stop profiling in a non-web application](https://github.com/teddymacn/CoreProfiler/blob/master/console-demo/Program.cs).
Sample Projects
---------------- [cross-app-profiling-demo](https://github.com/teddymacn/cross-app-profiling-demo) - Sample projects to demonstrate cross-application performance profiling with coreprofiler/nanoprofiler.