2022-12-06 22:53:37 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: AuSocketStats.hpp
|
|
|
|
Date: 2022-12-06
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Aurora/Utility/ThroughputCalculator.hpp>
|
|
|
|
|
|
|
|
namespace Aurora::IO::Net
|
|
|
|
{
|
|
|
|
struct SocketStats : ISocketStats
|
|
|
|
{
|
|
|
|
void AddBytes(AuUInt32 uBytes);
|
|
|
|
|
|
|
|
virtual AuInt64 GetFirstTickTimeMS() override;
|
|
|
|
|
|
|
|
virtual AuInt64 GetLastTickTimeMS() override;
|
|
|
|
|
|
|
|
virtual AuUInt64 GetTotalBytesTransferred() override;
|
|
|
|
|
|
|
|
virtual double GetApproximatedThroughput() override;
|
|
|
|
|
2023-10-23 08:04:36 +00:00
|
|
|
virtual AuUInt64 GetUptimeNS() override;
|
|
|
|
|
|
|
|
void Start();
|
|
|
|
void End();
|
|
|
|
|
2022-12-12 23:50:05 +00:00
|
|
|
AuUInt64 uLastTimeSteadyMS {};
|
2022-12-06 22:53:37 +00:00
|
|
|
private:
|
2023-09-28 14:42:09 +00:00
|
|
|
Aurora::Utility::ThroughputCalculator calculator;
|
2023-10-23 08:04:36 +00:00
|
|
|
AuUInt64 uFirstTime {};
|
|
|
|
AuUInt64 uStartSteadyTime {};
|
|
|
|
AuUInt64 uEndSteadyTime {};
|
2022-12-06 22:53:37 +00:00
|
|
|
};
|
|
|
|
}
|