55 lines
1.5 KiB
C#
55 lines
1.5 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using MP.Core.DTO;
|
|
using MP.Data.DbModels.Utils;
|
|
using MP.Data.Services.Utils;
|
|
|
|
namespace MP.IOC.Components.Pages
|
|
{
|
|
public partial class Index
|
|
{
|
|
#region Protected Methods
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
await ReloadData();
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Fields
|
|
|
|
private List<StatDataDTO> ListGlobalCall = new();
|
|
|
|
private List<StatsDetailModel> ListParetoCall = new();
|
|
|
|
private Dictionary<string, List<StatDataDTO>> paretoWeek = new();
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Private Properties
|
|
|
|
[Inject]
|
|
private IStatsAggrService StatsAggrService { get; set; } = null!;
|
|
|
|
[Inject]
|
|
private IStatsDetailService StatsDetService { get; set; } = null!;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
private async Task ReloadData()
|
|
{
|
|
DateTime oggi = DateTime.Today;
|
|
DateTime adesso = DateTime.Now;
|
|
var paretoDayCall = await StatsAggrService.GetParetoStatsDayAsync(0);
|
|
ListGlobalCall.Clear();
|
|
var rawMachPareto = paretoDayCall.FirstOrDefault(x => x.Key.Contains("Duration")).Value;
|
|
ListGlobalCall = rawMachPareto.Take(10).ToList();
|
|
ListParetoCall = await StatsDetService.GetParetoAsync(adesso.AddHours(-1), adesso, 10);
|
|
paretoWeek = await StatsAggrService.GetParetoStatsWeekAsync();
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |