< Summary

Information
Class: Orchestrator.Commands.Observability.Experiments.RunRepeatedMatchSliceCommand
Assembly: Orchestrator
File(s): /home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Commands/Observability/Experiments/RunRepeatedMatchSliceCommand.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 27
Coverable lines: 27
Total lines: 56
Line coverage: 0%
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%210%
ExecuteAsync()100%210%

File(s)

/home/runner/work/KicktippAi/KicktippAi/src/Orchestrator/Commands/Observability/Experiments/RunRepeatedMatchSliceCommand.cs

#LineLine coverage
 1using System.Text.Json;
 2using Microsoft.Extensions.Logging;
 3using Orchestrator.Infrastructure.Factories;
 4using Orchestrator.Infrastructure.Langfuse;
 5using Spectre.Console;
 6using Spectre.Console.Cli;
 7
 8namespace Orchestrator.Commands.Observability.Experiments;
 9
 10public sealed class RunRepeatedMatchSliceCommand : AsyncCommand<RunRepeatedMatchSliceSettings>
 11{
 12    private readonly IAnsiConsole _console;
 13    private readonly PreparedExperimentRunExecutor _executor;
 14    private readonly ILogger<RunRepeatedMatchSliceCommand> _logger;
 15
 016    public RunRepeatedMatchSliceCommand(
 017        IAnsiConsole console,
 018        IFirebaseServiceFactory firebaseServiceFactory,
 019        IOpenAiServiceFactory openAiServiceFactory,
 020        ILangfusePublicApiClient langfuseClient,
 021        ILogger<RunRepeatedMatchSliceCommand> logger)
 22    {
 023        _console = console;
 024        _executor = new PreparedExperimentRunExecutor(firebaseServiceFactory, openAiServiceFactory, langfuseClient);
 025        _logger = logger;
 026    }
 27
 28    protected override async Task<int> ExecuteAsync(
 29        CommandContext context,
 30        RunRepeatedMatchSliceSettings settings,
 31        CancellationToken cancellationToken)
 32    {
 33        try
 34        {
 035            var summary = await _executor.ExecuteAsync(
 036                "repeated-match-slice",
 037                new PreparedExperimentRunRequest(
 038                    settings.ManifestPath,
 039                    settings.RunName,
 040                    settings.RunDescription,
 041                    settings.RunMetadataFile,
 042                    settings.ReplaceRun,
 043                    settings.ToRunOptions()),
 044                cancellationToken);
 45
 046            _console.WriteLine(JsonSerializer.Serialize(summary, PreparedExperimentCommandSupport.JsonOptions));
 047            return 0;
 48        }
 049        catch (Exception ex)
 50        {
 051            _logger.LogError(ex, "Error executing run-repeated-match-slice command");
 052            _console.MarkupLine($"[red]Error:[/] {Markup.Escape(ex.Message)}");
 053            return 1;
 54        }
 055    }
 56}