BlazorWasmProfiler 0.0.1
dotnet add package BlazorWasmProfiler --version 0.0.1
NuGet\Install-Package BlazorWasmProfiler -Version 0.0.1
<PackageReference Include="BlazorWasmProfiler" Version="0.0.1" />
paket add BlazorWasmProfiler --version 0.0.1
#r "nuget: BlazorWasmProfiler, 0.0.1"
// Install BlazorWasmProfiler as a Cake Addin #addin nuget:?package=BlazorWasmProfiler&version=0.0.1 // Install BlazorWasmProfiler as a Cake Tool #tool nuget:?package=BlazorWasmProfiler&version=0.0.1
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:
Include NuGet package from https://www.nuget.org/packages/BlazorWasmProfiler
<ItemGroup> <PackageReference Include="BlazorWasmProfiler" Version="0.0.1.0" /> </ItemGroup>
Add
[assembly: BlazorTimer]
somewhere in your code.Access statistics:
var methodStatistics = BlazorTimerAttribute.GetMethodStatistics(); var renderStatistics = BlazorTimerAttribute.GetRenderStatistics();
(optional) Use
MethodCallStatistics
andRenderTimeStatistics
as components<BlazorWasmProfiler.MethodCallStatistics /> <BlazorWasmProfiler.RenderTimeStatistics />
(optional) Change
<Router AppAssembly="@typeof(App).Assembly">
to
<Router AppAssembly="@typeof(App).Assembly" AdditionalAssemblies="new[] { typeof(BlazorWasmProfiler.BlazorTimerAttribute).Assembly }">
and use
MethodCallStatistics
andRenderTimeStatistics
as pages<a href="MethodCallStatistics">Method Call Statistics</a> <a href="RenderTimeStatistics">Render Time Statistics</a>
Version history:
- 0.0.1.0:
- Excluded the body of
OnParametersSet()
andOnAfterRender(bool firstRender)
from render timing - Render timing now works with
OnParametersSetAsync()
andOnAfterRenderAsync(bool firstRender)
- Added
enum StatisticsOrder
to get statistics ordered by any property
- Excluded the body of
- 0.0.0.1:
- Initial release
Screenshots:
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- AspectInjector (>= 2.8.2)
- Microsoft.AspNetCore.Components.Web (>= 7.0.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.