{"id":15440836,"url":"https://github.com/gresau/gresau.tracing","last_synced_at":"2025-03-28T06:44:42.421Z","repository":{"id":66342984,"uuid":"223833790","full_name":"GREsau/GREsau.Tracing","owner":"GREsau","description":"Easy performance tracing for .NET Core 3","archived":false,"fork":false,"pushed_at":"2019-12-10T00:04:42.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T19:45:05.179Z","etag":null,"topics":["csharp","netcore3","performance"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/GREsau.Tracing","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GREsau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-25T00:54:23.000Z","updated_at":"2019-12-09T23:50:34.000Z","dependencies_parsed_at":"2023-03-10T23:52:49.154Z","dependency_job_id":null,"html_url":"https://github.com/GREsau/GREsau.Tracing","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GREsau%2FGREsau.Tracing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GREsau%2FGREsau.Tracing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GREsau%2FGREsau.Tracing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GREsau%2FGREsau.Tracing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GREsau","download_url":"https://codeload.github.com/GREsau/GREsau.Tracing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245984554,"owners_count":20704794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","netcore3","performance"],"created_at":"2024-10-01T19:15:31.570Z","updated_at":"2025-03-28T06:44:42.406Z","avatar_url":"https://github.com/GREsau.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GREsau.Tracing\nGREsau.Tracing is a library to perform performance tracing of .NET Core applications. Essentially, it is a simplified alternative to [dotnet-trace](https://github.com/dotnet/diagnostics/blob/master/documentation/dotnet-trace-instructions.md), consumable as a C# library rather than a CLI tool.\n\nGREsau.Tracing will only output `nettrace`-format files. These can be viewed on Windows using [PerfView](https://github.com/microsoft/perfview), or converted to `speedscope`-format using dotnet-trace's convert command, and then viewed at https://www.speedscope.app.\n```sh\n# Converts nettrace file to speedscope, writing to trace.speedscope.json\n\u003e dotnet-trace convert --format Speedscope trace.nettrace\n```\n\nThis library makes use of [Microsoft.Diagnostics.NETCore.Client](https://www.nuget.org/packages/Microsoft.Diagnostics.NETCore.Client). If you're looking for something more powerful/flexible and you're willing to accept the complexity that comes with that, consider using that library directly.\n\n## Installing\nInstall via NuGet:\n```sh\n\u003e dotnet add package GREsau.Tracing\n```\n\n## Basic Usage\n\nTo trace the current process for a period of time, saving the output file as \"trace.nettrace\":\n\n```csharp\nvar client = new TraceClient();\nawait client.CollectAsync(\"trace.nettrace\", TimeSpan.FromMinutes(1));\n```\n\nYou can also trace a different process by passing in its ID:\n\n```csharp\nvar client = new TraceClient(123);\nawait client.CollectAsync(\"trace.nettrace\", TimeSpan.FromMinutes(1));\n```\n\nBy default, `TraceClient` will track CPU usage and general .NET runtime information, equivalent to running dotnet-trace with the cpu-sampling (default) profile. If you want to trace something different, you can pass in a collection of `Microsoft.Diagnostics.NETCore.Client.EventPipeProvider`s:\n\n```csharp\nvar gcCollectProvider = new EventPipeProvider(\n    \"Microsoft-Windows-DotNETRuntime\",\n    EventLevel.Informational,\n    (long)(ClrTraceEventParser.Keywords.GC | ClrTraceEventParser.Keywords.Exception));\nvar client = new TraceClient(providers: new[] { gcCollectProvider });\nawait client.CollectAsync(\"trace.nettrace\", TimeSpan.FromMinutes(1));\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgresau%2Fgresau.tracing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgresau%2Fgresau.tracing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgresau%2Fgresau.tracing/lists"}