Extra Stat collection (#407)
* Cleaned up error interceptor to avoid sending auth errors (when a 500 occurs) to sentry as auth errors aren't issues. * Added extra stat collection * Fixed a bad gitignore which ignored anything in a stats directory
This commit is contained in:
parent
b9a06d3586
commit
b11bb0e3b5
18 changed files with 64 additions and 57 deletions
33
API/DTOs/Stats/UsageStatisticsDto.cs
Normal file
33
API/DTOs/Stats/UsageStatisticsDto.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace API.DTOs.Stats
|
||||
{
|
||||
public class UsageStatisticsDto
|
||||
{
|
||||
public UsageStatisticsDto()
|
||||
{
|
||||
MarkAsUpdatedNow();
|
||||
ClientsInfo = new List<ClientInfoDto>();
|
||||
}
|
||||
|
||||
public string InstallId { get; set; }
|
||||
public DateTime LastUpdate { get; set; }
|
||||
public UsageInfoDto UsageInfo { get; set; }
|
||||
public ServerInfoDto ServerInfo { get; set; }
|
||||
public List<ClientInfoDto> ClientsInfo { get; set; }
|
||||
|
||||
public void MarkAsUpdatedNow()
|
||||
{
|
||||
LastUpdate = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
public void AddClientInfo(ClientInfoDto clientInfoDto)
|
||||
{
|
||||
if (ClientsInfo.Any(x => x.IsTheSameDevice(clientInfoDto))) return;
|
||||
|
||||
ClientsInfo.Add(clientInfoDto);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue