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

/serverperformance command (Server Performance Monitor) #1642

Merged
merged 3 commits into from
Apr 4, 2019

Conversation

Mag-nus
Copy link
Member

@Mag-nus Mag-nus commented Apr 4, 2019

Optional parameters are:
start
stop
reset

If no parameters are present, the current performance metrics are spit out.

When disabled, overhead is the cost of some simple function calls and a bool check. When enabled, the additional cost is stopwatch events. In comparisson to the work that ACE does for normal processing, the work done when serverperformance is enabled is nearly 0.

Default is disabled.

Enable it to start up automatically in the config.js. This is recommend for most servers. Enable it at runtime using /serverperformance start

Optional parameters are:
start
stop
reset

If no parameters are present, the current performance metrics are spit out.

When disabled, overhead is the cost of some simple function calls and a bool check. When enabled, the additional cost is stopwatch events. In comparisson to the work that ACE does for normal processing, the work done when serverperformance is enabled is nearly 0.

Default is disabled.

Enable it to start up automatically in the config.js. This is recommend for most servers. Enable it at runtime using /serverperformance start
LtRipley36706
LtRipley36706 previously approved these changes Apr 4, 2019
@fartwhif
Copy link
Collaborator

fartwhif commented Apr 4, 2019

ACE.Plugin.Web and ACE.Plugin.API will have support for websockets as per the "high perf/throughput data" requirement, and this would be an ideal use with it. I haven't yet had the chance to review this, but just in case I'm asking that this also be "plugin-aware" so that the output can be funneled into another process, by use of event, action, etc. Please make its consumption generalized enough so that it can be used outside of the normal console+in game chat methods. This request is semi-related to the need for this generalization of the /serverstatus admin command and generalization of (formerly console only) command manager so that plugins can also use them.

@Mag-nus
Copy link
Member Author

Mag-nus commented Apr 4, 2019

fartwhif, It is written in a way that will allow plugin consumption.

ServerPerformanceMonitor is a public static class.
It exposes simple functions to Start/Stop/Reset.
It exposes a public ToString()
It also exposes public ways to get specific monitors.

I don't know how the plugins interact with the system yet, but, if they can access any of the static manager classes easily, then they will be able to control and get data from this resource.

@fartwhif
Copy link
Collaborator

fartwhif commented Apr 4, 2019

Nice, that's good to hear. Is there any way to have some kind of "streaming" mode, so that whenever the state changes that the new data, or the whole object, is then sent to all event subscribers? OnChange?.Invoke(this);

@Mag-nus
Copy link
Member Author

Mag-nus commented Apr 4, 2019

That woudldn't work for an object like this. The overhead would be immense.

This manager can be called tends of thousands of times a second. It's written in a very basic way to maximize performance at the expense of a little readability.

@fartwhif
Copy link
Collaborator

fartwhif commented Apr 4, 2019

I see, so a wrapper that polls it would be in order. Was worth asking. Thanks!

@Mag-nus Mag-nus merged commit 759b01a into ACEmulator:master Apr 4, 2019
@Mag-nus Mag-nus deleted the ServerPerformanceMonitor branch April 4, 2019 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants