Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jinjinov/blazorwasmprofiler
Poor Man's Blazor Wasm Profiler
https://github.com/jinjinov/blazorwasmprofiler
blazor blazor-client blazor-wasm blazor-webassembly profiler profiling wasm webassembly
Last synced: 3 months ago
JSON representation
Poor Man's Blazor Wasm Profiler
- Host: GitHub
- URL: https://github.com/jinjinov/blazorwasmprofiler
- Owner: Jinjinov
- License: mit
- Created: 2023-07-30T18:53:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-05T18:55:21.000Z (over 1 year ago)
- Last Synced: 2024-04-27T11:34:26.418Z (9 months ago)
- Topics: blazor, blazor-client, blazor-wasm, blazor-webassembly, profiler, profiling, wasm, webassembly
- Language: C#
- Homepage:
- Size: 193 KB
- Stars: 10
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# BlazorWasmProfiler
Poor Man's Blazor Wasm Profiler
It uses `AspectInjector` to time the execution of every method in your Blazor WASM project.
It also measures the render time of every Blazor Component that defines these methods:
protected override void OnParametersSet()
// or
protected override async Task OnParametersSetAsync()// and
protected override void OnAfterRender(bool firstRender)
// or
protected override async Task OnAfterRenderAsync(bool firstRender)## How to use:
1. Include NuGet package from https://www.nuget.org/packages/BlazorWasmProfiler
2. Add the attribute somewhere in your code
[assembly: BlazorTimer]
[assembly: MethodTimer]
[assembly: RenderTimer]3. Access statistics
var methodStatistics = BlazorTimerAttribute.GetMethodStatistics();
var renderStatistics = BlazorTimerAttribute.GetRenderStatistics();var methodStatistics = ExecutionStatistics.GetMethodStatistics();
var renderStatistics = ExecutionStatistics.GetRenderStatistics();4. (optional) Use `MethodCallStatistics` and `RenderTimeStatistics` as components
5. (optional) Change
to
and use `MethodCallStatistics` and `RenderTimeStatistics` as pages
Method Call Statistics
Render Time Statistics## Version history:
- 0.0.1.0:
- Excluded the body of `OnParametersSet()` and `OnAfterRender(bool firstRender)` from render timing
- Render timing now works with `OnParametersSetAsync()` and `OnAfterRenderAsync(bool firstRender)`
- Added `enum StatisticsOrder` to get statistics ordered by any property
- 0.0.0.1:
- Initial release## Screenshots:
![MethodCallStatistics](https://raw.githubusercontent.com/Jinjinov/BlazorWasmProfiler/main/MethodCallStatistics.png)
![RenderTimeStatistics](https://raw.githubusercontent.com/Jinjinov/BlazorWasmProfiler/main/RenderTimeStatistics.png)