IW4M-Admin/SharedLibraryCore/Interfaces/IServerDataViewer.cs

50 lines
2.1 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using SharedLibraryCore.Dtos;
namespace SharedLibraryCore.Interfaces
{
/// <summary>
2022-01-26 11:32:16 -05:00
/// Exposes methods to get analytical data about server(s)
/// </summary>
public interface IServerDataViewer
{
/// <summary>
2022-01-26 11:32:16 -05:00
/// Retrieves the max concurrent clients over a give time period for all servers or given server id
/// </summary>
/// <param name="serverId">ServerId to query on</param>
/// <param name="overPeriod">how far in the past to search</param>
/// <param name="token">CancellationToken</param>
/// <returns></returns>
2022-01-26 11:32:16 -05:00
Task<(int?, DateTime?)> MaxConcurrentClientsAsync(long? serverId = null, TimeSpan? overPeriod = null,
CancellationToken token = default);
/// <summary>
2022-01-26 11:32:16 -05:00
/// Gets the total number of clients connected and total clients connected in the given time frame
/// </summary>
/// <param name="overPeriod">how far in the past to search</param>
/// <param name="token">CancellationToken</param>
/// <returns></returns>
Task<(int, int)> ClientCountsAsync(TimeSpan? overPeriod = null, CancellationToken token = default);
/// <summary>
2022-01-26 11:32:16 -05:00
/// Retrieves the client count and history over the given period
/// </summary>
/// <param name="overPeriod">how far in the past to search</param>
/// <param name="token">CancellationToken</param>
/// <returns></returns>
2022-01-26 11:32:16 -05:00
Task<IEnumerable<ClientHistoryInfo>> ClientHistoryAsync(TimeSpan? overPeriod = null,
CancellationToken token = default);
/// <summary>
/// Retrieves the number of ranked clients for given server id
/// </summary>
/// <param name="serverId">ServerId to query on</param>
/// <param name="token">CancellationToken</param>
/// <returns></returns>
Task<int> RankedClientsCountAsync(long? serverId = null, CancellationToken token = default);
}
}