forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename activity file, fix NRE, rename start methods
- Loading branch information
1 parent
1122aa6
commit b857487
Showing
6 changed files
with
38 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. | ||
|
||
namespace FSharp.Compiler.Diagnostics | ||
|
||
open System | ||
open System.Diagnostics | ||
|
||
[<RequireQualifiedAccess>] | ||
module Activity = | ||
|
||
let private dummyDisposable = | ||
{ | ||
new IDisposable with | ||
member this.Dispose() = () | ||
} | ||
|
||
let private activitySourceName = "fsc" | ||
let private activitySource = new ActivitySource(activitySourceName) | ||
|
||
let start name (tags : (string * string) seq) : IDisposable = | ||
match activitySource.StartActivity(name) |> Option.ofObj with | ||
| Some activity -> | ||
for key, value in tags do | ||
activity.AddTag(key, value) |> ignore | ||
activity :> IDisposable | ||
| None -> | ||
dummyDisposable | ||
|
||
let startNoTags name: IDisposable = activitySource.StartActivity(name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters