AuroraRuntime/Source/IO/Net/AuSocketStats.hpp

38 lines
886 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;
virtual AuUInt64 GetUptimeNS() override;
void Start();
void End();
AuUInt64 uLastTimeSteadyMS {};
private:
Aurora::Utility::ThroughputCalculator calculator;
AuUInt64 uFirstTime {};
AuUInt64 uStartSteadyTime {};
AuUInt64 uEndSteadyTime {};
};
}