AuroraRuntime/Source/IO/Net/AuSocketStats.hpp

33 lines
787 B
C++
Raw Normal View History

/***
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;
AuUInt64 uLastTimeSteadyMS {};
private:
Aurora::Utility::ThroughputCalculator calculator;
AuInt64 iFirstTime {};
AuInt64 iLastTime {};
AuUInt64 uTotalTransferred {};
};
}