Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Commit f811a11

Browse files
IList -> IEnumerable (few of them) (#84)
* few IList replaced with IEnumerable * parent links from IList to IEnumerable * a few more of IList -> IEnumerable * one more * stats event with IEnumerable now * smal utils method should not use IList * another utility method
1 parent 81e1cc1 commit f811a11

File tree

28 files changed

+91
-94
lines changed

28 files changed

+91
-94
lines changed

src/OpenCensus.Abstractions/Trace/Export/IHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ public interface IHandler
2727
/// Exports the list of spans to the backend.
2828
/// </summary>
2929
/// <param name="spanDataList">Collection of spans to export.</param>
30-
void Export(IList<ISpanData> spanDataList);
30+
void Export(IEnumerable<ISpanData> spanDataList);
3131
}
3232
}

src/OpenCensus.Abstractions/Trace/ISampler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public interface ISampler
4242
/// </param>
4343
/// <param name="parentLinks">Links associated with the parent span.</param>
4444
/// <returns>True of span needs to be created. False otherwise.</returns>
45-
bool ShouldSample(ISpanContext parentContext, bool hasRemoteParent, ITraceId traceId, ISpanId spanId, string name, IList<ISpan> parentLinks);
45+
bool ShouldSample(ISpanContext parentContext, bool hasRemoteParent, ITraceId traceId, ISpanId spanId, string name, IEnumerable<ISpan> parentLinks);
4646
}
4747
}

src/OpenCensus.Abstractions/Trace/ISpanBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public interface ISpanBuilder
3636
/// </summary>
3737
/// <param name="parentLinks">Parent links to set on span.</param>
3838
/// <returns>This span builder for chaining.</returns>
39-
ISpanBuilder SetParentLinks(IList<ISpan> parentLinks);
39+
ISpanBuilder SetParentLinks(IEnumerable<ISpan> parentLinks);
4040

4141
/// <summary>
4242
/// Set the record events value.

src/OpenCensus.Abstractions/Trace/Sampler/AlwaysSampleSampler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public string Description
3232
}
3333
}
3434

35-
public bool ShouldSample(ISpanContext parentContext, bool hasRemoteParent, ITraceId traceId, ISpanId spanId, string name, IList<ISpan> parentLinks)
35+
public bool ShouldSample(ISpanContext parentContext, bool hasRemoteParent, ITraceId traceId, ISpanId spanId, string name, IEnumerable<ISpan> parentLinks)
3636
{
3737
return true;
3838
}

src/OpenCensus.Abstractions/Trace/Sampler/NeverSampleSampler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public string Description
3232
}
3333
}
3434

35-
public bool ShouldSample(ISpanContext parentContext, bool hasRemoteParent, ITraceId traceId, ISpanId spanId, string name, IList<ISpan> parentLinks)
35+
public bool ShouldSample(ISpanContext parentContext, bool hasRemoteParent, ITraceId traceId, ISpanId spanId, string name, IEnumerable<ISpan> parentLinks)
3636
{
3737
return false;
3838
}

src/OpenCensus.Abstractions/Trace/Sampler/ProbabilitySampler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public string Description
4040

4141
public long IdUpperBound { get; }
4242

43-
public bool ShouldSample(ISpanContext parentContext, bool hasRemoteParent, ITraceId traceId, ISpanId spanId, string name, IList<ISpan> parentLinks)
43+
public bool ShouldSample(ISpanContext parentContext, bool hasRemoteParent, ITraceId traceId, ISpanId spanId, string name, IEnumerable<ISpan> parentLinks)
4444
{
4545
// If the parent is sampled keep the sampling decision.
4646
if (parentContext != null && parentContext.TraceOptions.IsSampled)

src/OpenCensus.Exporter.ApplicationInsights/Implementation/TraceExporterHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public TraceExporterHandler(TelemetryConfiguration telemetryConfiguration)
3434
this.telemetryClient = new TelemetryClient(telemetryConfiguration);
3535
}
3636

37-
public void Export(IList<ISpanData> spanDataList)
37+
public void Export(IEnumerable<ISpanData> spanDataList)
3838
{
3939
foreach (var span in spanDataList)
4040
{

src/OpenCensus.Exporter.Ocagent/Implementation/TraceExporterHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public TraceExporterHandler(string agentEndpoint, string hostName, string servic
7272
this.Start();
7373
}
7474

75-
public void Export(IList<ISpanData> spanDataList)
75+
public void Export(IEnumerable<ISpanData> spanDataList)
7676
{
7777
if (this.cts == null || this.cts.IsCancellationRequested)
7878
{

src/OpenCensus.Exporter.Stackdriver/Implementation/StackdriverTraceExporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static StackdriverTraceExporter()
182182
}
183183
}
184184

185-
public void Export(IList<ISpanData> spanDataList)
185+
public void Export(IEnumerable<ISpanData> spanDataList)
186186
{
187187
TraceServiceClient traceWriter = TraceServiceClient.Create(settings: traceServiceSettings);
188188

src/OpenCensus.Exporter.Zipkin/Implementation/TraceExporterHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public TraceExporterHandler(ZipkinTraceExporterOptions options, HttpClient clien
4646
this.httpClient = client ?? new HttpClient();
4747
}
4848

49-
public void Export(IList<ISpanData> spanDataList)
49+
public void Export(IEnumerable<ISpanData> spanDataList)
5050
{
5151
List<ZipkinSpan> zipkinSpans = new List<ZipkinSpan>();
5252

0 commit comments

Comments
 (0)