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)[源代码]¶ 基类:
evennia.commands.command.Command
Dummyrunner 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
()[源代码]¶ 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': '\n Dummyrunner command measuring the round-about response time\n from sending to receiving a result.\n\n Usage:\n dummyrunner_echo_response <timestamp>\n\n Responds with\n dummyrunner_echo_response:<timestamp>,<current_time>\n\n The dummyrunner will send this and then compare the send time\n with the receive time on both ends.\n\n '}¶
-
class
evennia.server.profiling.dummyrunner.
DummyRunnerCmdSet
(cmdsetobj=None, key=None)[源代码]¶ 基类:
evennia.commands.cmdset.CmdSet
Dummyrunner injected cmdset.
-
at_cmdset_creation
()[源代码]¶ 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
()[源代码]¶ Makes unique ids.
- 返回
str – A globally unique id.
-
evennia.server.profiling.dummyrunner.
gidcounter
()[源代码]¶ Makes globally unique ids.
- 返回
count (int); A globally unique counter.
-
evennia.server.profiling.dummyrunner.
makeiter
(obj)[源代码]¶ Makes everything iterable.
- 参数
obj (any) – Object to turn iterable.
- 返回
iterable (iterable) – An iterable object.
-
class
evennia.server.profiling.dummyrunner.
DummyClient
[源代码]¶ 基类:
twisted.conch.telnet.StatefulTelnetProtocol
Handles connection to a running Evennia server, mimicking a real account by sending commands on a timer.
-
dataReceived
(data)[源代码]¶ Called when data comes in over the protocol. We wait to start stepping until the server actually responds
- 参数
data (str) – Incoming data.
-