feat(api, core): WorkloadReport - добавлено поле max
This commit is contained in:
@@ -57,6 +57,8 @@ namespace PARR.API.Contracts.V1.Responses.Statistics
|
||||
public int Count { get; init; }
|
||||
|
||||
public double Average { get; init; }
|
||||
|
||||
public int Max { get; init; }
|
||||
}
|
||||
|
||||
public record WorkloadDayItemResponse
|
||||
|
||||
@@ -168,7 +168,8 @@ namespace PARR.Core.Services.Workload.Implementations
|
||||
static WorkloadSummaryItem Calc(List<WorkloadDailyItem> dailyMetrics, int allDays, Func<WorkloadDailyItem, int> selector) => new()
|
||||
{
|
||||
Count = dailyMetrics.Sum(selector),
|
||||
Average = allDays > 0 ? Math.Round((double)dailyMetrics.Sum(selector) / allDays, 2) : 0
|
||||
Average = allDays > 0 ? Math.Round((double)dailyMetrics.Sum(selector) / allDays, 2) : 0,
|
||||
Max = dailyMetrics.Max(selector)
|
||||
};
|
||||
|
||||
return new WorkloadSummary
|
||||
|
||||
@@ -58,6 +58,8 @@ namespace PARR.Domain.DTOs.Workload
|
||||
public int Count { get; init; }
|
||||
|
||||
public double Average { get; init; }
|
||||
|
||||
public int Max { get; set; }
|
||||
}
|
||||
|
||||
public record WorkloadDayItem
|
||||
|
||||
Reference in New Issue
Block a user