Generates the files required by JMeter.
More...
|
| dot (int $number, int $total) |
| Outputs dots.
|
|
| end_log () |
| Ends a log string that was started using log function with $leaveopen.
|
|
| log (string $langstring, $a=null, bool $leaveopen=false, string $module='tool_generator') |
| Displays information as part of progress.
|
|
|
int const | DEFAULT_SIZE = 3 |
| Default size index.
|
|
int const | MAX_SIZE = 5 |
| Highest (largest) size index.
|
|
int const | MIN_SIZE = 0 |
| Lowest (smallest) size index.
|
|
|
static | generate_test_plan ($targetcourseid, $size) |
| Generates the test plan according to the target course contents.
|
|
static | generate_users_file ($targetcourseid, $updateuserspassword, ?int $size=null) |
| Generates the user's credentials file with all the course's users.
|
|
static | get_course_test_data ($targetcourseid) |
| Gets the data required to fill the test plan template with the database contents.
|
|
static | get_file_record ($filearea, $filetype) |
| Returns a tool_generator file record.
|
|
|
string object array int | $aparam |
| Optional language string parameters.
|
|
int bool | $filesizelimit |
| Maximum number of bytes for file.
|
|
bool | $fixeddataset |
| True if we want a fixed dataset or false to generate random data.
|
|
string | $langstring |
| Part of the language string.
|
|
string | $module |
| Module for the language string.
|
|
bool | $progress |
| True if displaying progress.
|
|
progress_bar | $progressbar |
| progressbar
|
|
int | $size |
| Size code (index in the above arrays)
|
|
int | $starttime |
| Epoch time at which current step (current set of dots) started.
|
|
|
static Number | $loops = array(5, 5, 5, 6, 6, 7) |
| of loops depending on the selected size.
|
|
static Rampup | $rampups = array(1, 6, 40, 100, 500, 800) |
| period depending on the selected size.
|
|
static The | $repourl = 'https://github.com/moodlehq/moodle-performance-comparison' |
| URL to the repository of the external project.
|
|
static Number | $users = array(1, 30, 100, 1000, 5000, 10000) |
| of users depending on the selected size.
|
|
Generates the files required by JMeter.
- Copyright
- 2013 David MonllaĆ³
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ create_testplan_file()
static tool_generator_testplan_backend::create_testplan_file |
( |
| $courseid, |
|
|
| $size ) |
|
static |
Creates the test plan file.
- Parameters
-
int | $courseid | The target course id |
int | $size | The test plan size |
- Return values
-
◆ create_users_file()
static tool_generator_testplan_backend::create_users_file |
( |
| $courseid, |
|
|
| $updateuserspassword, |
|
|
?int | $size = null ) |
|
static |
Creates the users data file.
- Parameters
-
int | $courseid | The target course id |
bool | $updateuserspassword | Updates the course users password to $CFG->tool_generator_users_password |
int | null | $size | of the test plan. Used to limit the number of users exported to match the threads in the plan. For BC, defaults to null that means all enrolled users. |
- Return values
-
◆ dot()
tool_generator_backend::dot |
( |
int | $number, |
|
|
int | $total ) |
|
inherited |
Outputs dots.
There is up to one dot per second. Once a minute, it displays a percentage.
- Parameters
-
int | $number | Number of completed items |
int | $total | Total number of items to complete |
◆ generate_test_plan()
static tool_generator_testplan_backend::generate_test_plan |
( |
| $targetcourseid, |
|
|
| $size ) |
|
staticprotected |
Generates the test plan according to the target course contents.
- Parameters
-
int | $targetcourseid | The target course id |
int | $size | The test plan size |
- Return values
-
string | The test plan as a string |
◆ generate_users_file()
static tool_generator_testplan_backend::generate_users_file |
( |
| $targetcourseid, |
|
|
| $updateuserspassword, |
|
|
?int | $size = null ) |
|
staticprotected |
Generates the user's credentials file with all the course's users.
- Parameters
-
int | $targetcourseid | |
bool | $updateuserspassword | Updates the course users password to $CFG->tool_generator_users_password |
int | null | $size | of the test plan. Used to limit the number of users exported to match the threads in the plan. For BC, defaults to null that means all enrolled users. |
- Return values
-
string | The users csv file contents. |
◆ get_course_test_data()
static tool_generator_testplan_backend::get_course_test_data |
( |
| $targetcourseid | ) |
|
|
staticprotected |
Gets the data required to fill the test plan template with the database contents.
- Parameters
-
int | $targetcourseid | The target course id |
- Return values
-
stdClass | The ids required by the test plan |
◆ get_file_record()
static tool_generator_testplan_backend::get_file_record |
( |
| $filearea, |
|
|
| $filetype ) |
|
staticprotected |
Returns a tool_generator file record.
- Parameters
-
string | $filearea | testplan or users |
string | $filetype | The file extension jmx or csv |
- Return values
-
stdClass | The file record to use when creating tool_generator files |
◆ get_repourl()
static tool_generator_testplan_backend::get_repourl |
( |
| ) |
|
|
static |
Getter for moodle-performance-comparison project URL.
- Return values
-
◆ get_size_choices()
static tool_generator_testplan_backend::get_size_choices |
( |
| ) |
|
|
static |
Gets a list of size choices supported by this backend.
- Return values
-
array | List of size (int) => text description for display |
◆ has_selected_course_any_problem()
static tool_generator_testplan_backend::has_selected_course_any_problem |
( |
| $course, |
|
|
| $size ) |
|
static |
Checks if the selected target course is ok.
- Parameters
-
int | string | $course | |
int | $size | |
- Return values
-
array | Errors array or false if everything is ok |
◆ log()
tool_generator_backend::log |
( |
string | $langstring, |
|
|
| $a = null, |
|
|
bool | $leaveopen = false, |
|
|
string | $module = 'tool_generator' ) |
|
inherited |
Displays information as part of progress.
- Parameters
-
string | $langstring | Part of langstring (after progress_) |
mixed | $a | Optional lang string parameters |
bool | $leaveopen | If true, doesn't close LI tag (ready for dots) |
string | $module | module for language string |
◆ size_for_name()
static tool_generator_backend::size_for_name |
( |
| $sizename | ) |
|
|
staticinherited |
Converts a size name into the numeric constant.
- Parameters
-
string | $sizename | Size name e.g. 'L' |
- Return values
-
- Exceptions
-
The documentation for this class was generated from the following file:
- admin/tool/generator/classes/testplan_backend.php