BotSharp/src/Infrastructure/BotSharp.Abstraction/Statistics/Models/BotSharpStats.cs

34 lines
884 B
C#
Raw Normal View History

2025-01-24 05:45:43 +00:00
namespace BotSharp.Abstraction.Statistics.Models;
public class BotSharpStats
{
[JsonPropertyName("category")]
public string Category { get; set; } = null!;
[JsonPropertyName("group")]
public string Group { get; set; } = null!;
[JsonPropertyName("data")]
2025-01-28 05:10:37 +00:00
public IDictionary<string, double> Data { get; set; } = new Dictionary<string, double>();
2025-01-24 05:45:43 +00:00
2025-01-24 19:42:17 +00:00
private DateTime innerRecordTime;
2025-01-24 05:45:43 +00:00
2025-01-24 19:42:17 +00:00
[JsonPropertyName("record_time")]
public DateTime RecordTime
2025-01-24 05:45:43 +00:00
{
get
{
2025-01-24 19:42:17 +00:00
return innerRecordTime;
2025-01-24 05:45:43 +00:00
}
set
{
var date = new DateTime(value.Year, value.Month, value.Day, value.Hour, 0, 0);
2025-01-24 19:42:17 +00:00
innerRecordTime = DateTime.SpecifyKind(date, DateTimeKind.Utc);
2025-01-24 05:45:43 +00:00
}
}
public override string ToString()
{
2025-01-24 19:42:17 +00:00
return $"{Category}-{Group}: {Data?.Count ?? 0} ({RecordTime})";
2025-01-24 05:45:43 +00:00
}
}