< Summary

Information
Class: IceRpc.TelemetryPipelineExtensions
Assembly: IceRpc.Telemetry
File(s): /home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Telemetry/TelemetryPipelineExtensions.cs
Tag: 275_13775359185
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 23
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage
0%
Covered methods: 0
Total methods: 1
Method coverage: 0%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
UseTelemetry(...)100%210%

File(s)

/home/runner/work/icerpc-csharp/icerpc-csharp/src/IceRpc.Telemetry/TelemetryPipelineExtensions.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3using IceRpc.Telemetry;
 4using System.Diagnostics;
 5
 6namespace IceRpc;
 7
 8/// <summary>Provides an extension method for <see cref="Pipeline" /> to add the telemetry interceptor.
 9/// </summary>
 10public static class TelemetryPipelineExtensions
 11{
 12    /// <summary>Adds the <see cref="TelemetryInterceptor" /> to the pipeline.</summary>
 13    /// <param name="pipeline">The pipeline being configured.</param>
 14    /// <param name="activitySource">The <see cref="ActivitySource" /> used to start the request activity.</param>
 15    /// <returns>The pipeline being configured.</returns>
 16    /// <example>
 17    /// The following code adds the telemetry interceptor to the invocation pipeline.
 18    /// <code source="../../docfx/examples/IceRpc.Telemetry.Examples/TelemetryInterceptorExamples.cs" region="UseTelemet
 19    /// </example>
 20    /// <seealso href="https://github.com/icerpc/icerpc-csharp/tree/main/examples/Telemetry"/>
 21    public static Pipeline UseTelemetry(this Pipeline pipeline, ActivitySource activitySource) =>
 022        pipeline.Use(next => new TelemetryInterceptor(next, activitySource));
 23}