$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
This file contains hidden or 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
[MemoryDiagnoser] | |
public class Program | |
{ | |
private const int NumberOfLabels = IPAddressParserStatics.IPv6AddressBytes / 2; | |
private static readonly uint ScopeId; | |
private static readonly ushort[] Numbers; | |
static Program() | |
{ | |
var ipAddress = IPAddress.Parse("2001:4860:4860::8888"); |
This file contains hidden or 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
public class Poller<TData> | |
{ | |
private readonly Func<Task<TData>> _func; | |
private Task<TData> _task; | |
private int _hasData; | |
// Returns default values before first poll. | |
public TData Data { get; private set; } | |
public bool HasData => _hasData == 1; |
This file contains hidden or 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
public class Syncer<TKey, TResult> | |
{ | |
private readonly ConcurrentDictionary<TKey, TaskCompletionSource<TResult>> _taskCompletionSources = new ConcurrentDictionary<TKey, TaskCompletionSource<TResult>>(); | |
public Task<TResult> RunAsync(TKey key, Func<Task<TResult>> func) | |
{ | |
var newTaskCompletionSource = new TaskCompletionSource<TResult>(); | |
var existingTaskCompletionSource = _taskCompletionSources.GetOrAdd(key, newTaskCompletionSource); | |
if (newTaskCompletionSource == existingTaskCompletionSource) | |
{ |
This file contains hidden or 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
// * Detailed results * | |
Program_GetSystemTimeAsFileTime | |
Mean = 15.0677 ns, StdError = 0.0775 ns (0.51%); N = 60, StdDev = 0.6000 ns | |
Min = 14.3962 ns, Q1 = 14.6196 ns, Median = 14.8500 ns, Q3 = 15.3732 ns, Max = 17.0593 ns | |
IQR = 0.7536 ns, LowerFence = 13.4891 ns, UpperFence = 16.5036 ns | |
ConfidenceInterval = [14.9159 ns; 15.2195 ns] (CI 95%) | |
Program_UtcNow | |
Mean = 5.0350 ns, StdError = 0.0096 ns (0.19%); N = 110, StdDev = 0.1007 ns |
This file contains hidden or 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
public static class LogicalFlow | |
{ | |
private static ImmutableStack<Guid> LogicalStack | |
{ | |
get | |
{ | |
return CallContext.LogicalGetData("LogicalFlow") as ImmutableStack<Guid> ?? ImmutableStack.Create<Guid>(); | |
} | |
set | |
{ |
This file contains hidden or 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
00000000-0000-0000-0000-000000000000 | |
fdc22318-53ef-4ae5-83ff-6c3e3864e37a | |
fdc22318-53ef-4ae5-83ff-6c3e3864e37a | |
fdc22318-53ef-4ae5-83ff-6c3e3864e37a | |
00000000-0000-0000-0000-000000000000 |
This file contains hidden or 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
public static IDisposable StartScope() | |
{ | |
CallContext.LogicalSetData("Bar", "Arnon"); | |
Trace.CorrelationManager.StartLogicalOperation(); | |
return new Stopper(); | |
} |
This file contains hidden or 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
00000000-0000-0000-0000-000000000000 | |
49985135-1e39-404c-834a-9f12026d9b65 | |
54674452-e1c5-4b1b-91ed-6bd6ea725b98 | |
c6ec00fd-bff8-4bde-bf70-e073b6714ae5 | |
54674452-e1c5-4b1b-91ed-6bd6ea725b98 |
This file contains hidden or 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
public static class LogicalFlow | |
{ | |
public static Guid CurrentOperationId | |
{ | |
get | |
{ | |
return Trace.CorrelationManager.LogicalOperationStack.Count > 0 | |
? (Guid) Trace.CorrelationManager.LogicalOperationStack.Peek() | |
: Guid.Empty; | |
} |
NewerOlder