Send program start time, not connection time.

This commit is contained in:
Bartosz Taudul 2017-10-04 00:34:05 +02:00
parent 2f14704143
commit 3f0bd793fd
2 changed files with 3 additions and 1 deletions

View File

@ -61,6 +61,7 @@ static Profiler* s_instance = nullptr;
Profiler::Profiler() Profiler::Profiler()
: m_mainThread( GetThreadHandle() ) : m_mainThread( GetThreadHandle() )
, m_epoch( std::chrono::duration_cast<std::chrono::seconds>( std::chrono::system_clock::now().time_since_epoch() ).count() )
, m_shutdown( false ) , m_shutdown( false )
, m_stream( LZ4_createStream() ) , m_stream( LZ4_createStream() )
, m_buffer( new char[TargetFrameSize*3] ) , m_buffer( new char[TargetFrameSize*3] )
@ -128,7 +129,7 @@ void Profiler::Worker()
welcome.timeBegin = m_timeBegin; welcome.timeBegin = m_timeBegin;
welcome.delay = m_delay; welcome.delay = m_delay;
welcome.resolution = m_resolution; welcome.resolution = m_resolution;
welcome.epoch = std::chrono::duration_cast<std::chrono::seconds>( std::chrono::system_clock::now().time_since_epoch() ).count(); welcome.epoch = m_epoch;
memcpy( welcome.programName, procname, pnsz ); memcpy( welcome.programName, procname, pnsz );
memset( welcome.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz ); memset( welcome.programName + pnsz, 0, WelcomeMessageProgramNameSize - pnsz );

View File

@ -100,6 +100,7 @@ private:
uint64_t m_delay; uint64_t m_delay;
int64_t m_timeBegin; int64_t m_timeBegin;
uint64_t m_mainThread; uint64_t m_mainThread;
uint64_t m_epoch;
std::thread m_thread; std::thread m_thread;
std::atomic<bool> m_shutdown; std::atomic<bool> m_shutdown;
std::unique_ptr<Socket> m_sock; std::unique_ptr<Socket> m_sock;