< Summary

Information
Class: Elsa.Workflows.Api.Endpoints.ActivityExecutions.Report.Report
Assembly: Elsa.Workflows.Api
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Endpoints/ActivityExecutions/Report/Endpoint.cs
Line coverage
53%
Covered lines: 7
Uncovered lines: 6
Coverable lines: 13
Total lines: 40
Line coverage: 53.8%
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%
Configure()100%11100%
ExecuteAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Endpoints/ActivityExecutions/Report/Endpoint.cs

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.Workflows.Runtime;
 3using JetBrains.Annotations;
 4
 5namespace Elsa.Workflows.Api.Endpoints.ActivityExecutions.Report;
 6
 7/// <summary>
 8/// Gets a report for the specified set of activities that includes number of executions, split by completed and non-com
 9/// </summary>
 10[PublicAPI]
 11internal class Report : ElsaEndpoint<Request, Response>
 12{
 13    private readonly IActivityExecutionStore _store;
 14    private readonly IActivityExecutionStatsService _activityExecutionStatsService;
 15
 16    /// <inheritdoc />
 117    public Report(IActivityExecutionStore store, IActivityExecutionStatsService activityExecutionStatsService)
 18    {
 119        _store = store;
 120        _activityExecutionStatsService = activityExecutionStatsService;
 121    }
 22
 23    /// <inheritdoc />
 24    public override void Configure()
 25    {
 126        Post("/activity-executions/report");
 127        ConfigurePermissions("read:activity-execution");
 128    }
 29
 30    /// <inheritdoc />
 31    public override async Task<Response> ExecuteAsync(Request request, CancellationToken cancellationToken)
 32    {
 033        var stats = (await _activityExecutionStatsService.GetStatsAsync(request.WorkflowInstanceId, request.ActivityNode
 34
 035        return new()
 036        {
 037            Stats = stats
 038        };
 039    }
 40}