Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiler results are now sent to Redis #17459

Merged
merged 1 commit into from
Mar 8, 2022

Conversation

AffectedArc07
Copy link
Member

What Does This PR Do

Adds functionality for throwing profiler data at Redis every time SSprofiler fires

Why It's Good For The Game

By sending the profiler data to something that isn't byond, we can do more things with it, such as track time changes between procs, measure specific procs over time with profiler snapshots, and more.

I plan to have this data received by a Java application encompassing a frontend, redis backend for this, database management and more, but that is still WIP.

As for the performance impact of this, it results at taking this much time to encode and send.
image

I know this may seem higher than good (especially since FFI blocks), but you have to remember that this SS fires every 5 minutes, which is a pretty long delay. On top of that, I noticed no delay while walking around the station and having this fire every 5 seconds, and thats with 0 latency. Most of the delay is on encoding, which is non-tick-blocking [FFI calls halt the entire tick]. My Redis server is also not on the same machine and is 2 switch hops away, whereas on prod it is simulated inside the same RAM as the game server since its all virtualised, not to mention prod having a much beefier CPU.

Changelog

🆑 AffectedArc07
add: Added support for sending profiler metrics out of the game for finer profiler detail
wip: Frontend coming soon
/:cl:

@AffectedArc07 AffectedArc07 added the Feature This PR is a new addition to the game label Feb 27, 2022
ffi_data["round_id"] = GLOB.round_id
// We dont have to JSON decode here. The other end can worry about a 2-layer decode.
// Performance matters on this end. It doesnt on the other end
ffi_data["profile_data"] = current_profile_data
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to see how expensive encode/decode is here, as it may decrease send time due to the send size being much smaller from not having tons of extra escapes in
image

Copy link
Member Author

@AffectedArc07 AffectedArc07 Feb 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update:

lol no
image

Yes the send cost is lower, but the encode cost halted DD for 4 whole seconds. We're not doing that.

@AffectedArc07
Copy link
Member Author

Ran on prod, seems fine
image

@AffectedArc07
Copy link
Member Author

Test Merge Updated

Server Instance

paradise_main

Merged By

AffectedArc07

Revision

Origin: 6070a92
Pull Request: a113327
Server: da04cfcddd8fadf1a603cff25d2d53fa6bf52174

@dearmochi dearmochi merged commit e19931c into ParadiseSS13:master Mar 8, 2022
github-actions bot added a commit that referenced this pull request Mar 8, 2022
@AffectedArc07
Copy link
Member Author

Test Merge Removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature This PR is a new addition to the game
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants