EmberTrace.Abstractions
0.2.1
dotnet add package EmberTrace.Abstractions --version 0.2.1
NuGet\Install-Package EmberTrace.Abstractions -Version 0.2.1
<PackageReference Include="EmberTrace.Abstractions" Version="0.2.1" />
<PackageVersion Include="EmberTrace.Abstractions" Version="0.2.1" />
<PackageReference Include="EmberTrace.Abstractions" />
paket add EmberTrace.Abstractions --version 0.2.1
#r "nuget: EmberTrace.Abstractions, 0.2.1"
#:package EmberTrace.Abstractions@0.2.1
#addin nuget:?package=EmberTrace.Abstractions&version=0.2.1
#tool nuget:?package=EmberTrace.Abstractions&version=0.2.1
Русская версия: ./README.ru.md
EmberTrace
EmberTrace is a fast in-process tracer/profiler for .NET with minimal overhead on the hot path:
- Allocation-free Begin/End and no global locks (thread-local buffers)
- Flows for links between threads and
async/await - Offline analysis after stopping a session (aggregations + reports)
- Export to Chrome Trace (for
chrome://tracing/ Perfetto)
Installation
The easiest option is the metapackage:
dotnet add package EmberTrace.All
If you install packages selectively:
EmberTrace- runtime API (Tracer.*)EmberTrace.Abstractions- attributes ([assembly: TraceId(...)])EmberTrace.Generator- source generator (automatically registers metadata)EmberTrace.Analysis- session processing (session.Process())EmberTrace.ReportText- text report (TraceText.Write(...))EmberTrace.Export- Chrome Trace export (TraceExport.*)EmberTrace.OpenTelemetry- export to OpenTelemetry (Activityspans)EmberTrace.RoslynAnalyzers- analyzers and code fixes for correct usage (fixes run in IDE and are included in the package)
Quick Start
- Define IDs and metadata (in any project file, at the assembly level):
using EmberTrace.Abstractions.Attributes;
[assembly: TraceId(1000, "App", "App")]
[assembly: TraceId(2000, "Worker", "Workers")]
- Wrap the required sections in scopes:
using EmberTrace;
Tracer.Start();
using (Tracer.Scope(1000))
{
// работа
}
var session = Tracer.Stop();
- Generate a report and/or export:
var processed = session.Process();
var meta = Tracer.CreateMetadata(); // if generator is used — metadata will be registered automatically
Console.WriteLine(TraceText.Write(processed, meta: meta, topHotspots: 20, maxDepth: 8));
using var fs = File.Create("out/trace.json");
TraceExport.WriteChromeComplete(session, fs, meta: meta);
- Open
out/trace.json:
chrome://tracing(Chrome)- Perfetto (web UI) - convenient for large traces
Repository Example
The most complete example is samples/EmberTrace.Demo3 (scopes + flows + async + export + text report):
dotnet run --project samples/EmberTrace.Demo3 -c Release
# files will be in samples/EmberTrace.Demo3/out
Documentation
- Index
- Quick Start
- Usage and API
- Flow and async
- Export
- Analysis and reports
- Generator and metadata
- Troubleshooting
Build and Tests
Requires the SDK specified in global.json.
dotnet build -c Release
dotnet test -c Release
Benchmarks and AOT
dotnet run --project benchmarks/EmberTrace.Benchmarks -c Release -- --filter *ScopeBenchmarks*
dotnet publish samples/EmberTrace.NativeAot -c Release -p:PublishAot=true
Screenshots
Example of a simple trace in Perfetto
Useful Links
- Documentation: docs/index.md
- Examples: samples/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on EmberTrace.Abstractions:
| Package | Downloads |
|---|---|
|
EmberTrace.All
Meta package that pulls EmberTrace runtime, generator, analysis, export, and text reporting. |
GitHub repositories
This package is not used by any popular GitHub repositories.