TestPackage - Mini-IT/SnipeWiki GitHub Wiki

Test Messages

Location: snipe/packages/test/

This package defines various test messages for checking basic Snipe server core mechanisms and performance testing. You can also use it as a reference point for the implementation in your project.

This package is already included into the server but disabled by default unless you enable the debug compilation flag "debug_test_package" in the .hxml files for game server, cache server and/or uniserver. You can read more about it in the Debug Compilation Flags article. You should never enable this package in production!

All of the test messages have test scripts for script-based tool contained in the "test/" directory. Also note that none of the messages require user login.

The included test messages are:

  • "packages/test.asyncQuery" - Performs an asynchronous SQL query using the snipe.slave.CacheConnection.asyncQuery() API.
  • "packages/test.count" - Same as "packages/test.ping" with the addition of returning "n" request field (acts as a counter).
  • "packages/test.migrate" - Migrates the client to a randomly chosen game server.
  • "packages/test.ping" - Pings the slave server and returns. Can be used to measure the raw slave server message handling overhead and minimal server response time.
  • "packages/test.pingAsync" - Transfers the call to the cache server where it runs it through the asynchronous worker snipe.cache.AsyncWorker.call() API. No actual work is done. Notifies the client after it is done. Can be used to measure raw asynchronous worker call overhead.
  • "packages/test.pingCache" - Pings the cache server synchronously, receives the response and immediately notifies the client. Can be used to measure the raw cache server call overhead.
  • "packages/test.query" - Makes a synchronized SQL query call to database. Note that in normal mode the query goes through the cache server database connection. In uniserver mode each slave server has its own database connection. Can be used to measure raw SQL query overhead and performance.
  • "packages/test.test" - Does a small amount of work in the main slave server thread and notifies the client after it is done.
  • "packages/test.testAsync" - Transfers the call to the cache server where it runs through the asynchronous worker snipe.cache.AsyncWorker.call() API. Some work is done in the asynchronous worker thread. Notifies the client after the work is done.
  • "packages/test.testCache" - Makes a synchronized call to the cache server where it does a small amount of work and returns to the slave server. Notifies the client after the work is done.
⚠️ **GitHub.com Fallback** ⚠️