Packet Profiler - accurately measure remote packet bandwidth!

Packet Profiler

by Pyseph

Get the plugin here


Introduction

Packet Profiler is a plugin which allows you to accurately read remote data sent by different contexts. Unlike the vague and uninformative Stats windows which only show the current KB/s receive and send rates, this plugin allows you to accurately see packet data each frame, along with precise byte size information.

Functionality

Packet Profiler was made with design slightly similar to the MicroProfiler, which is Roblox’s performance debugging tool. You can pause the profiler either by manually clicking the button, or selecting any frame.
When left-clicking a frame, the contents of that frame will be shown in the Packet Chart window, in the form of a pie chart along with columns of data to the right:
image

You can open up each column and see the exact remote data which was sent. The data shows how much bytes each field takes so that you can more easily determine what takes up most size.
image

Since data sizes vary for different games, you can adjust the scale of each frame through the KB scale on the topbar, like so:
RobloxStudioBeta_anIlck0Ih7

Additionally, some games may use network wrappers that have nonsensical remote names, so you can adjust item labels in the chart by placing a RemoteName.profiler ModuleScript anywhere in ReplicatedStorage. The module must return a function that returns a string, and is provided two arguments:

  • The remote object which was invoked
  • The first argument passed by the remote, which can be anything or nothing

In-game profiling

Sometimes, simply profiling in studio may not be enough. As such, you can use this plugin in-game! Simply grab the latest release .rbxm file and place it inside StarterPlayerScripts. You can then open the UI through Ctrl + F5, and pause/unpause through Ctrl + P.
https://github.com/PysephWasntAvailable/PacketProfiler/releases/

Alternatively, you can install the in-game profiler through Wally:
https://wally.run/package/pysephwasntavailable/packetprofiler

How much does it cost?

This plugin is free! The objective is to democratize in-depth analysis towards remotes to help games both big and small in creating large experiences.


Link to plugin: PacketProfiler - Roblox

GitHub Link: https://github.com/PysephWasntAvailable/PacketProfiler

91 Likes

PSA

This plugin wasn’t made with the notion of being able to calculate the packet sizes down to every byte. Roblox doesn’t offer any way to measure incoming packets, and so the only way to find out how large they are is by manually calculating the size based on input data.
There’s some incorrectness towards how some data types such as strings are calculated, but it becomes hard to fully replicate undocumented behavior.

Roblox pls document packet encoding behavior or give APIs to measure packets

6 Likes

What a great tool you have made here!!!

This is really cool! I’m not the best using debuggers but I understand their power and for someone who cares that much about network usage as me this can be pretty useful. Clearly a much cooler way of viewing network traffic other than using the Stats or CTRL + F7.

I’ll also check the source code, I always wondered how I could do so to track the data that remotes use in my game, this may open my eyes.

Edit: Actually looked up at the source code and to be honest, the way in which you get the packet info seems pretty intuitive, but I never thought about it hehe. Also, thank you for those useful links to documentation about datatypes.

1 Like

v1.0.1

  • Added asserts to make sure RemoteName.profiler module returns a function
  • Fixed pie chart scrolling frame’s canvas size being larger than the amount of items
  • You can now click on the columns next to the pie chart and see the raw remote data which was sent
    image
3 Likes

Yoink! Downloading this right now.

1 Like

v1.0.2

  • Added syntax highlighting to packet data shown in the packet chart
    image
  • Renamed TableToString.lua to more fitting TableToSyntaxString.lua
1 Like

v1.0.3

  • Added byte size counts for individual elements, E.g number → 10 bytes
  • Added UI padding to data elements in pie chart
  • Improved pie chart visual UI

image

2 Likes

v.1.0.4..v1.0.7

  • Fixed right-side padding of packet data in pie chart
  • Enabled clipping bounds for packet data in pie chart
  • Pie chart and tooltip now show 3 decimal places in KB instead of 2
  • added 100 byte and 10 byte scale options
  • Server context ignores first argument (Player)
  • Pie chart uses different units based on packet size
  • Remote connections are now only instantiated when you open the profiler, as to prevent the plugin from taking priority from other remote connections
  • Fixed first packet argument not being logged properly
  • Fixed an issue where byte size was incorrectly calculated when ran on server context

This is an absolutely phenomenal plugin! Great job!

1 Like

v1.0.8

  • Updated booleans to take 2 bytes to pass through remotes instead of 1
  • Updated Faces and Axes to take 6 bytes to pass through remotes instead of 1
  • If remote data is over the max rich-text character limit, font colors are removed
  • Remote data fields now use scrolling frames to allow scrolling through long packets
  • Changed chart item separator to be same size as remote data
2 Likes

v1.1.0

  • Added support for in-game profiling. A separate section has been added for this in the original post!
  • Moved Running indicator towards the rightmost side of the profiler bar to allow clicking without interfering with CoreGui menu UI
  • Fixed Running indicator’s Y-axis size being 0
1 Like

v1.2.0

  • Added Wally support
  • Reorganized file structure to separate plugin, studio and in-game workflows
  • Added installation methods for the plugin on the GitHub repository page

I am attempting to use this in-game and it spits out an error:

Not quite sure what I did wrong. I followed the steps under “In-game profiling”

I’ll look into it. Thanks for the report!

I’ve updated the releases page with a newer version. Could you update your code and confirm that it works?

This is extremely great, I love it.

Is there a way to see other stuff perhaps like Instance replication? I suspect that might be very complicated, maybe impossible, but it would be nice to have.

Roblox does not provide any APIs to listen to packets sent by non-remotes - only way to do so would be through packet sniffers, which directly intercept remotes sent to-and-fro the Roblox client.
The only in-house way to do so currently is through the Stats window, which has a Network tab.

I downloaded v1.2.0 from the releases page, and I’m getting the same error as before.

Could you try this version and see if it works for you?
releasebuild.rbxm (100.0 KB)