feat(api,core): Методы в API для получения метрик заданий роботам, StatRobotMetricsController.
This commit is contained in:
9
PARR.Domain/DTOs/RobotMetrics/FilteredChartPoint.cs
Normal file
9
PARR.Domain/DTOs/RobotMetrics/FilteredChartPoint.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace PARR.Domain.DTOs.RobotMetrics
|
||||
{
|
||||
/// <summary>
|
||||
/// Статистика по роботам, согласно гибким фильтрам.
|
||||
/// </summary>
|
||||
/// <param name="Timestamp"></param>
|
||||
/// <param name="Count"></param>
|
||||
public record FilteredChartPoint(DateTimeOffset Timestamp, int Count);
|
||||
}
|
||||
16
PARR.Domain/DTOs/RobotMetrics/MetricFilter.cs
Normal file
16
PARR.Domain/DTOs/RobotMetrics/MetricFilter.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using PARR.Domain.Enums;
|
||||
|
||||
namespace PARR.Domain.DTOs.RobotMetrics
|
||||
{
|
||||
public record MetricFilter
|
||||
{
|
||||
public RobotsEnum? RobotCode { get; init; }
|
||||
public RobotStatusEnum? RobotStatusCode { get; init; }
|
||||
public TaskStatusEnum? TaskStatusCode { get; init; }
|
||||
public DateTimeOffset? DateFrom { get; init; }
|
||||
public DateTimeOffset? DateTo { get; init; }
|
||||
|
||||
// Шаг группировки в минутах (например, 2, 30, 60, 1440)
|
||||
public int IntervalMinutes { get; set; } = 30;
|
||||
}
|
||||
}
|
||||
7
PARR.Domain/DTOs/RobotMetrics/RobotStatusChartPoint.cs
Normal file
7
PARR.Domain/DTOs/RobotMetrics/RobotStatusChartPoint.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace PARR.Domain.DTOs.RobotMetrics
|
||||
{
|
||||
/// <summary>
|
||||
/// Статистика по Робот Сатусам, на графике
|
||||
/// </summary>
|
||||
public record RobotStatusChartPoint(DateTimeOffset Timestamp, int Wait, int InProgress, int Error, int Complete);
|
||||
}
|
||||
11
PARR.Domain/DTOs/RobotMetrics/TaskStatusChartPoint.cs
Normal file
11
PARR.Domain/DTOs/RobotMetrics/TaskStatusChartPoint.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace PARR.Domain.DTOs.RobotMetrics
|
||||
{
|
||||
/// <summary>
|
||||
/// Статистика по Статусам заданий роботам, на графике
|
||||
/// </summary>
|
||||
/// <param name="Timestamp"></param>
|
||||
/// <param name="Creating"></param>
|
||||
/// <param name="Updating"></param>
|
||||
/// <param name="Ok"></param>
|
||||
public record TaskStatusChartPoint(DateTimeOffset Timestamp, int Creating, int Updating, int Ok);
|
||||
}
|
||||
26
PARR.Domain/Enums/ChartPeriod.cs
Normal file
26
PARR.Domain/Enums/ChartPeriod.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PARR.Domain.Enums
|
||||
{
|
||||
/// <summary>
|
||||
/// Периоды для графиков
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public enum ChartPeriod
|
||||
{
|
||||
/// <summary>
|
||||
/// Последние 2 часа
|
||||
/// </summary>
|
||||
TwoHours = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Последние 24 часа
|
||||
/// </summary>
|
||||
TwentyFourHours = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Последняя неделя
|
||||
/// </summary>
|
||||
SevenDays = 3
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user