| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | using IceRpc.Metrics; |
| | 4 | |
|
| | 5 | | namespace IceRpc; |
| | 6 | |
|
| | 7 | | /// <summary>Provides an extension method for <see cref="Pipeline" /> to add the metrics interceptor.</summary> |
| | 8 | | public static class MetricsPipelineExtensions |
| | 9 | | { |
| | 10 | | /// <summary>Adds a <see cref="MetricsInterceptor" /> to the pipeline.</summary> |
| | 11 | | /// <param name="pipeline">The pipeline being configured.</param> |
| | 12 | | /// <returns>The pipeline being configured.</returns> |
| | 13 | | /// <example> |
| | 14 | | /// The following code adds the metrics interceptor to the invocation pipeline. |
| | 15 | | /// <code source="../../docfx/examples/IceRpc.Metrics.Examples/MetricsInterceptorExamples.cs" region="UseMetrics" la |
| | 16 | | /// </example> |
| | 17 | | /// <seealso href="https://github.com/icerpc/icerpc-csharp/tree/main/examples/Metrics"/> |
| | 18 | | public static Pipeline UseMetrics(this Pipeline pipeline) => |
| 0 | 19 | | pipeline.Use(next => new MetricsInterceptor(next)); |
| | 20 | | } |