Skip to content

Commit 63583de

Browse files
committed
Clean up
1 parent 70d4d78 commit 63583de

File tree

3 files changed

+6
-47
lines changed

3 files changed

+6
-47
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.Collections.ObjectModel;
55

66
namespace Aspire.Dashboard.Otlp.Model;
77

8-
public sealed class SpanCollection : KeyedCollection<string, OtlpSpan>
8+
public sealed class OtlpSpanCollection : KeyedCollection<string, OtlpSpan>
99
{
1010
// Chosen to balance memory usage overhead of dictionary vs work to find spans by ID.
1111
private const int DictionaryCreationThreshold = 128;
1212

13-
public SpanCollection() : base(StringComparers.OtlpSpanId, DictionaryCreationThreshold)
13+
public OtlpSpanCollection() : base(StringComparers.OtlpSpanId, DictionaryCreationThreshold)
1414
{
1515
}
1616

@@ -21,6 +21,7 @@ protected override string GetKeyForItem(OtlpSpan item)
2121

2222
public new List<OtlpSpan>.Enumerator GetEnumerator()
2323
{
24+
// Avoid allocating an enumerator when iterated with foreach.
2425
return ((List<OtlpSpan>)this.Items).GetEnumerator();
2526
}
2627
}

src/Aspire.Dashboard/Otlp/Model/OtlpTrace.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public TimeSpan Duration
3434
}
3535
}
3636

37-
public SpanCollection Spans { get; } = new SpanCollection();
37+
public OtlpSpanCollection Spans { get; } = new OtlpSpanCollection();
3838

3939
public int CalculateDepth(OtlpSpan span)
4040
{
@@ -115,7 +115,7 @@ private static bool HasCircularReference(OtlpSpan span)
115115
}
116116

117117
// Walk up span ancestors to check there is no loop.
118-
var stack = new SpanCollection { span };
118+
var stack = new OtlpSpanCollection { span };
119119
var currentSpan = span;
120120
while (currentSpan.GetParentSpan() is { } parentSpan)
121121
{

src/Aspire.Dashboard/Otlp/Model/OtlpTraceCollection.cs

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)