diff options
Diffstat (limited to 'modules/multiplayer/editor')
-rw-r--r-- | modules/multiplayer/editor/editor_network_profiler.cpp | 10 | ||||
-rw-r--r-- | modules/multiplayer/editor/editor_network_profiler.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp index a7e5b80b66..c78b32ed49 100644 --- a/modules/multiplayer/editor/editor_network_profiler.cpp +++ b/modules/multiplayer/editor/editor_network_profiler.cpp @@ -67,8 +67,8 @@ void EditorNetworkProfiler::_update_frame() { } node->set_text(0, E.value.node_path); - node->set_text(1, E.value.incoming_rpc == 0 ? "-" : itos(E.value.incoming_rpc)); - node->set_text(2, E.value.outgoing_rpc == 0 ? "-" : itos(E.value.outgoing_rpc)); + node->set_text(1, E.value.incoming_rpc == 0 ? "-" : vformat(TTR("%d (%s)"), E.value.incoming_rpc, String::humanize_size(E.value.incoming_size))); + node->set_text(2, E.value.outgoing_rpc == 0 ? "-" : vformat(TTR("%d (%s)"), E.value.outgoing_rpc, String::humanize_size(E.value.outgoing_size))); } } @@ -99,6 +99,12 @@ void EditorNetworkProfiler::add_node_frame_data(const RPCNodeInfo p_frame) { nodes_data[p_frame.node].incoming_rpc += p_frame.incoming_rpc; nodes_data[p_frame.node].outgoing_rpc += p_frame.outgoing_rpc; } + if (p_frame.incoming_rpc) { + nodes_data[p_frame.node].incoming_size = p_frame.incoming_size / p_frame.incoming_rpc; + } + if (p_frame.outgoing_rpc) { + nodes_data[p_frame.node].outgoing_size = p_frame.outgoing_size / p_frame.outgoing_rpc; + } if (frame_delay->is_stopped()) { frame_delay->set_wait_time(0.1); diff --git a/modules/multiplayer/editor/editor_network_profiler.h b/modules/multiplayer/editor/editor_network_profiler.h index 98d12e3c0a..65d08dcd56 100644 --- a/modules/multiplayer/editor/editor_network_profiler.h +++ b/modules/multiplayer/editor/editor_network_profiler.h @@ -66,7 +66,7 @@ protected: static void _bind_methods(); public: - void add_node_frame_data(const RPCNodeInfo p_frame); + void add_node_frame_data(RPCNodeInfo p_frame); void set_bandwidth(int p_incoming, int p_outgoing); bool is_profiling(); |