Add max concurrent players over 24 hours badge to home
This commit is contained in:
17
SharedLibraryCore/Interfaces/IServerDataCollector.cs
Normal file
17
SharedLibraryCore/Interfaces/IServerDataCollector.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SharedLibraryCore.Interfaces
|
||||
{
|
||||
public interface IServerDataCollector
|
||||
{
|
||||
/// <summary>
|
||||
/// Begins to collection on servers for analytical purposes
|
||||
/// </summary>
|
||||
/// <param name="period">interval at which to collect data</param>
|
||||
/// <param name="cancellationToken">Token</param>
|
||||
/// <returns>Task</returns>
|
||||
Task BeginCollectionAsync(TimeSpan? period = null, CancellationToken cancellationToken = default);
|
||||
}
|
||||
}
|
29
SharedLibraryCore/Interfaces/IServerDataViewer.cs
Normal file
29
SharedLibraryCore/Interfaces/IServerDataViewer.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SharedLibraryCore.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Exposes methods to get analytical data about server(s)
|
||||
/// </summary>
|
||||
public interface IServerDataViewer
|
||||
{
|
||||
/// <summary>
|
||||
/// 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>
|
||||
Task<int> MaxConcurrentClientsAsync(long? serverId = null, TimeSpan? overPeriod = null, CancellationToken token = default);
|
||||
|
||||
/// <summary>
|
||||
/// 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"></param>
|
||||
/// <returns></returns>
|
||||
Task<(int, int)> ClientCountsAsync(TimeSpan? overPeriod = null, CancellationToken token = default);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user