< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.Diagnostics.NoOpPipelineMetrics
Assembly: NexusLabs.Needlr.AgentFramework
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/Diagnostics/NoOpPipelineMetrics.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 35
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
get_ActivitySource()100%11100%
RecordPipelineStarted(...)100%11100%
RecordPipelineCompleted(...)100%11100%
RecordStageCompleted(...)100%11100%
Dispose()100%11100%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework/Diagnostics/NoOpPipelineMetrics.cs

#LineLine coverage
 1using System.Diagnostics;
 2
 3namespace NexusLabs.Needlr.AgentFramework.Diagnostics;
 4
 5/// <summary>
 6/// No-op <see cref="IPipelineMetrics"/> implementation. Registered as the DI
 7/// default when the consumer has not configured <see cref="PipelineMetricsOptions"/>
 8/// via <c>ConfigurePipelineMetrics</c> on the agent-framework syringe — pipeline
 9/// observability is opt-in with zero overhead by default. Same posture as
 10/// <see cref="IAgentMetrics"/> when no <see cref="AgentFrameworkMetricsOptions"/>
 11/// is configured at the <c>IAgentMetrics</c> level today.
 12/// </summary>
 13/// <remarks>
 14/// All <see cref="IPipelineMetrics"/> methods are no-ops. The exposed
 15/// <see cref="ActivitySource"/> uses a unique source name with the suffix
 16/// <c>".NoOp"</c> so that an unintentional listener attached to
 17/// <c>"NexusLabs.Needlr.AgentFramework.Pipelines"</c> does not accidentally pick
 18/// up no-op activities — listeners must explicitly opt into the <c>".NoOp"</c>
 19/// source if they want to capture this no-op output (which they almost never do).
 20/// </remarks>
 21[DoNotAutoRegister]
 22internal sealed class NoOpPipelineMetrics : IPipelineMetrics, IDisposable
 23{
 7624    private readonly ActivitySource _activitySource = new("NexusLabs.Needlr.AgentFramework.Pipelines.NoOp");
 25
 16726    public ActivitySource ActivitySource => _activitySource;
 27
 6928    public void RecordPipelineStarted(string pipelineName) { }
 29
 6930    public void RecordPipelineCompleted(string pipelineName, bool succeeded, TimeSpan duration) { }
 31
 10432    public void RecordStageCompleted(string pipelineName, IAgentStageResult stage, TimeSpan duration) { }
 33
 534    public void Dispose() => _activitySource.Dispose();
 35}