mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Display throughput plot.
This commit is contained in:
parent
d7c09605d6
commit
74f692c254
@ -11,6 +11,7 @@
|
||||
#include "../common/TracyProtocol.hpp"
|
||||
#include "../common/TracySystem.hpp"
|
||||
#include "../common/TracyQueue.hpp"
|
||||
#include "../imgui/imgui.h"
|
||||
#include "TracyView.hpp"
|
||||
|
||||
namespace tracy
|
||||
@ -259,4 +260,29 @@ void View::UpdateZone( uint64_t idx )
|
||||
assert( zone.end != -1 );
|
||||
}
|
||||
|
||||
void View::Draw()
|
||||
{
|
||||
s_instance->DrawImpl();
|
||||
}
|
||||
|
||||
void View::DrawImpl()
|
||||
{
|
||||
// Connection window
|
||||
{
|
||||
const auto mbps = m_mbps.back();
|
||||
char buf[64];
|
||||
if( mbps < 0.1f )
|
||||
{
|
||||
sprintf( buf, "%.2f Kbps", mbps * 1000.f );
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( buf, "%.2f Mbps", mbps );
|
||||
}
|
||||
ImGui::Begin( m_addr.c_str() );
|
||||
ImGui::PlotLines( buf, m_mbps.data(), m_mbps.size(), 0, nullptr, 0 );
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ public:
|
||||
~View();
|
||||
|
||||
static bool ShouldExit();
|
||||
static void Draw();
|
||||
|
||||
private:
|
||||
void Worker();
|
||||
@ -43,6 +44,8 @@ private:
|
||||
void NewZone( uint64_t idx );
|
||||
void UpdateZone( uint64_t idx );
|
||||
|
||||
void DrawImpl();
|
||||
|
||||
std::string m_addr;
|
||||
|
||||
Socket m_sock;
|
||||
|
Loading…
Reference in New Issue
Block a user