Measuring RPC Size in Bytes

Options
Hi, I'm trying to find a way to analyze the bandwidth usage of our game and I could use some advice.

I'd like to figure out which RPC's are using the most bandwidth. I've already added code that how tracks many times each RPC is received, now I just need to find away measuring the actual size of the RPC's.

Can you suggest a method of calculating the total size of a received RPC?
Perhaps by adding some code to NetworkingPeer.ExecuteRPC?

Thanks! :)

Comments

  • Tobias
    Options
    Huh. For that you need to modify PUN.
    The lower level library counts bytes per operation, so you have to find where the operation call takes place and immediately in the next line you can get ByteCountLastOperation. In NetworkingPeer.RPC you will find OpRaiseEvent at the end and in the next line you could fetch this.ByteCountLastOperation. It should be available by default. If not, try turning on traffic stats (in the NetworkingPeer it would be TrafficStatsEnabled = true;). I can't say for sure at the moment if stats are required or not for op size.
  • Merrik
    Options
    Thanks Tobias!

    That works like a charm!
    I'm just grabbing the 'methodName' and 'ByteCountLastOperation' at the end of NetworkingPeer.RPC() and sticking them in a Dictionary. :)