evennia.server.profiling.dummyrunner¶
Dummy client runner
This module implements a stand-alone launcher for stress-testing an Evennia game. It will launch any number of fake clients. These clients will log into the server and start doing random operations. Customizing and weighing these operations differently depends on which type of game is tested. The module contains a testing module for plain Evennia.
Please note that you shouldn’t run this on a production server! Launch the program without any arguments or options to see a full step-by-step setup help.
Basically (for testing default Evennia):
Use an empty/testing database.
set PERMISSION_ACCOUNT_DEFAULT = “Builder”
start server, eventually with profiling active
launch this client runner
If you want to customize the runner’s client actions (because you changed the cmdset or needs to better match your use cases or add more actions), you can change which actions by adding a path to
DUMMYRUNNER_ACTIONS_MODULE = <path.to.your.module>
in your settings. See utils.dummyrunner_actions.py for instructions on how to define this module.
- class evennia.server.profiling.dummyrunner.CmdDummyRunnerEchoResponse(**kwargs)[source]¶
Bases:
CommandDummyrunner command measuring the round-about response time from sending to receiving a result.
- Usage:
dummyrunner_echo_response <timestamp>
- Responds with
dummyrunner_echo_response:<timestamp>,<current_time>
The dummyrunner will send this and then compare the send time with the receive time on both ends.
- key = 'dummyrunner_echo_response'¶
- func()[source]¶
This is the actual executing part of the command. It is called directly after self.parse(). See the docstring of this module for which object properties are available (beyond those set in self.parse())
- aliases = []¶
- help_category = 'general'¶
- lock_storage = 'cmd:all();'¶
- search_index_entry = {'aliases': '', 'category': 'general', 'key': 'dummyrunner_echo_response', 'no_prefix': ' ', 'tags': '', 'text': '\nDummyrunner command measuring the round-about response time\nfrom sending to receiving a result.\n\nUsage:\n dummyrunner_echo_response <timestamp>\n\nResponds with\n dummyrunner_echo_response:<timestamp>,<current_time>\n\nThe dummyrunner will send this and then compare the send time\nwith the receive time on both ends.\n\n'}¶
- class evennia.server.profiling.dummyrunner.DummyRunnerCmdSet(cmdsetobj=None, key=None)[source]¶
Bases:
CmdSetDummyrunner injected cmdset.
- at_cmdset_creation()[source]¶
Hook method - this should be overloaded in the inheriting class, and should take care of populating the cmdset by use of self.add().
- path = 'evennia.server.profiling.dummyrunner.DummyRunnerCmdSet'¶
- evennia.server.profiling.dummyrunner.idcounter()[source]¶
Makes unique ids.
- Returns:
str – A globally unique id.
- evennia.server.profiling.dummyrunner.gidcounter()[source]¶
Makes globally unique ids.
- Returns:
count (int); A globally unique counter.
- evennia.server.profiling.dummyrunner.makeiter(obj)[source]¶
Makes everything iterable.
- Parameters:
obj (any) – Object to turn iterable.
- Returns:
iterable (iterable) – An iterable object.
- class evennia.server.profiling.dummyrunner.DummyClient[source]¶
Bases:
StatefulTelnetProtocolHandles connection to a running Evennia server, mimicking a real account by sending commands on a timer.
- dataReceived(data)[source]¶
Called when data comes in over the protocol. We wait to start stepping until the server actually responds
- Parameters:
data (str) – Incoming data.
- connectionLost(reason)[source]¶
Called when loosing the connection.
- Parameters:
reason (str) – Reason for loosing connection.