Initial commit - Pingerino network monitoring application

هذا الالتزام موجود في:
Era
2025-08-19 07:34:27 +03:00
التزام 243f4787dd
41 ملفات معدلة مع 12352 إضافات و0 حذوفات

عرض الملف

@@ -0,0 +1,67 @@
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Pingerino.Services.Interfaces
{
public interface IPingService : IDisposable
{
event EventHandler<PingResultEventArgs> PingCompleted;
event EventHandler<NetworkStatisticsEventArgs> StatisticsUpdated;
System.Threading.Tasks.Task StartPingingAsync(string ipAddress, int intervalMs, CancellationToken cancellationToken = default);
System.Threading.Tasks.Task StopPingingAsync();
System.Threading.Tasks.Task<PingResult> PingOnceAsync(string ipAddress, CancellationToken cancellationToken = default);
void ClearStatistics();
NetworkStatistics GetCurrentStatistics();
bool IsRunning { get; }
}
public class PingResultEventArgs : EventArgs
{
public PingResult Result { get; }
public DateTime Timestamp { get; }
public PingResultEventArgs(PingResult result, DateTime timestamp)
{
Result = result;
Timestamp = timestamp;
}
}
public class NetworkStatisticsEventArgs : EventArgs
{
public NetworkStatistics Statistics { get; }
public NetworkStatisticsEventArgs(NetworkStatistics statistics)
{
Statistics = statistics;
}
}
public class PingResult
{
public string IpAddress { get; set; }
public bool IsSuccess { get; set; }
public long RoundTripTime { get; set; }
public string Status { get; set; }
public string ErrorMessage { get; set; }
}
public class NetworkStatistics
{
public double Jitter { get; set; }
public double PacketLoss { get; set; }
public long MaxPing { get; set; }
public long MinPing { get; set; }
public double AveragePing { get; set; }
public double MaxJitter { get; set; }
public double MinJitter { get; set; }
public double AverageJitter { get; set; }
public double MaxPacketLoss { get; set; }
public double MinPacketLoss { get; set; }
public double AveragePacketLoss { get; set; }
public int TotalPings { get; set; }
public int SuccessfulPings { get; set; }
}
}