Note: You are currently viewing documentation for Moodle 3.9. Up-to-date documentation for the latest stable version of Moodle may be available here: Test course generator.

Test course generator: Difference between revisions

From MoodleDocs
mNo edit summary
(Transferred the content of https://docs.moodle.org/dev/Load_testing_Moodle_with_JMeter#Make_test_course to this page.)
Line 1: Line 1:
{{Developer tools}}
{{Developer tools}}
If you want a large course for testing performance or reliability of a feature (where its behaviour might depend on the size of a course), you can generate standard-sized test courses using the generator tool at ''Administration > Site administration > Development > Make a test course''.,
If you want a sample course for load testing or reliability of a feature (where its behaviour might depend on the size of a course), you can generate standardized test courses using the generator tool at ''Administration > Site administration > Development > Make a test course''.,


== Requirements ==
''Warning: This tool is for developer use only! Courses created using this feature can occupy a large amount of database and consume disk space (tens of gigabytes). Although you can delete those courses (and wait for various cleanup runs) to release the space they consumed, this tool should not be used on a live site. For safety it is disabled unless you set Site administration > Development > Debugging: Debug messages to DEVELOPER. ''


This tool is for developer use only and should not be used on a live site. It is disabled unless you set the debugging option to DEVELOPER.
== Using the tool ==


== Finding the generator tool ==
# First set the debugging level to DEVELOPER as mentioned in the warning above.
# If you want to set a password for all the generated users, add the line "$CFG->tool_generator_users_password = 'YOURSECRET';" to config.php of Moodle. If the password does not comply with the site security policy to set "$CFG->passwordpolicy = 0;" too.


The tool is in the administration menu under Development / Make test course.
=== GUI version ===
# Visit Administration > Site administration > Development > Make a test course.


== Using the tool ==
==== Options ====
* Size of course: You can choose amoung XS, S, M, L, XL, or XXL (required). The table below shows their difference.


To use the tool, select a size and type a shortname. The shortname should be one that is not in use. (If you type one that's in use, it will tell you.)
Please note that bigger courses take longer to be created - the biggest up to 4 hours on a decent server. Your server may run out of space or time out if it can't handle the size you selected.


The tool shows an estimate of how large the created course will be and how long it will take to create. These are rough estimates.
{| class="wikitable" border="1"
|-
! Size of course
! Approx. size
! No. of assignments
! No. of pages
! No. of small files
! No. of big files
! No. of sections
! No. of users
! No. of forum posts
! Approx. time to create
|-
! XS
| 10 kB
| 1
| 1
| 1
| 1
| 1
| 1
| 2
| 1 sec
|-
! S
| 10 MB
| 10
| 50
| 64
| 2
| 10
| 100
| 20
| 30 sec
|-
! M
| 100 MB
| 100
| 200
| 128
| 5
| 100
| 1,000
| 500
| 2 min
|-
! L
| 1 GB
| 500
| 1,000
| 1,024
| 10
| 500
| 10,000
| 5,000
| 30 min
|-
! XL
| 10 GB
| 1,000
| 5,000
| 16,384
| 10
| 1,000
| 50,000
| 10,000
| 2 hours
|-
! XXL
| 20 GB
| 2,000
| 10,000
| 32,768
| 10
| 2,000
| 100,000
| 20,000
| 4 hours
|}


* The 'M' course size (100 sections) is similar to a typical course at a large institution. This is useful for testing performance under normal conditions.
* Short name: The course short name (required)
* The 'XL' course is very large and is suitable for testing reliability under extreme conditions.
* Course full name and description (optional)


=== Options ===
==== Sample output ====
* Shortname: The course shortname (required)
  Creating course
* Size: The size of the generated course. Accepted values: XS, S, M, L, XL, or XXL (required)
  Creating [Course name]
  Creating assignments (100): . . . . . . . . . . . . done (12.7s)
  Creating pages (200): . . done (1.5s)
  Creating small files (128): done (0.4s)
  Creating big files (5): . done (1.3s)
  Checking user accounts (1000)
  Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)
  Enrolling users into course (1000): . . . . . . done (5.7s)
  Creating forum (500 posts): . . done (1.7s)
  Course completed (32.2s)


== CLI version ==
== CLI version ==
Line 31: Line 121:
This will show command-line options.
This will show command-line options.


=== Additional options ===
=== Options ===
Adding to the options mentioned above the CLI command has a few more.
In addition to the options in the GUI version the CLI command has the following options:


* Use a fixed dataset: Use a fixed data set instead of randomly generated data, useful for generating a standard data set
* Use a fixed dataset: Use a fixed data set instead of randomly generated data, useful for generating a standard data set
Line 38: Line 128:
* By pass check: Bypasses the developer-mode check
* By pass check: Bypasses the developer-mode check
* Quiet: Do not show any output
* Quiet: Do not show any output
[[File:make-a-test-course.png|thumb]]


[[es:Generador de curso de prueba]]
[[es:Generador de curso de prueba]]
[[de:Testkurs-Generator]]
[[de:Testkurs-Generator]]

Revision as of 09:57, 27 July 2021

If you want a sample course for load testing or reliability of a feature (where its behaviour might depend on the size of a course), you can generate standardized test courses using the generator tool at Administration > Site administration > Development > Make a test course.,

Warning: This tool is for developer use only! Courses created using this feature can occupy a large amount of database and consume disk space (tens of gigabytes). Although you can delete those courses (and wait for various cleanup runs) to release the space they consumed, this tool should not be used on a live site. For safety it is disabled unless you set Site administration > Development > Debugging: Debug messages to DEVELOPER.

Using the tool

  1. First set the debugging level to DEVELOPER as mentioned in the warning above.
  2. If you want to set a password for all the generated users, add the line "$CFG->tool_generator_users_password = 'YOURSECRET';" to config.php of Moodle. If the password does not comply with the site security policy to set "$CFG->passwordpolicy = 0;" too.

GUI version

  1. Visit Administration > Site administration > Development > Make a test course.

Options

  • Size of course: You can choose amoung XS, S, M, L, XL, or XXL (required). The table below shows their difference.

Please note that bigger courses take longer to be created - the biggest up to 4 hours on a decent server. Your server may run out of space or time out if it can't handle the size you selected.

Size of course Approx. size No. of assignments No. of pages No. of small files No. of big files No. of sections No. of users No. of forum posts Approx. time to create
XS 10 kB 1 1 1 1 1 1 2 1 sec
S 10 MB 10 50 64 2 10 100 20 30 sec
M 100 MB 100 200 128 5 100 1,000 500 2 min
L 1 GB 500 1,000 1,024 10 500 10,000 5,000 30 min
XL 10 GB 1,000 5,000 16,384 10 1,000 50,000 10,000 2 hours
XXL 20 GB 2,000 10,000 32,768 10 2,000 100,000 20,000 4 hours
  • Short name: The course short name (required)
  • Course full name and description (optional)

Sample output

 Creating course
 Creating [Course name]
 Creating assignments (100): . . . . . . . . . . . . done (12.7s)
 Creating pages (200): . . done (1.5s)
 Creating small files (128): done (0.4s)
 Creating big files (5): . done (1.3s)
 Checking user accounts (1000)
 Creating user accounts (1 - 1000): . . . . . . . . done (8.7s)
 Enrolling users into course (1000): . . . . . . done (5.7s)
 Creating forum (500 posts): . . done (1.7s)
 Course completed (32.2s)

CLI version

You can run the tool from the command-line using:

php admin/tool/generator/cli/maketestcourse.php

This will show command-line options.

Options

In addition to the options in the GUI version the CLI command has the following options:

  • Use a fixed dataset: Use a fixed data set instead of randomly generated data, useful for generating a standard data set
  • Specify a file size limit: Limits the size of the generated files to the specified number of bytes, you may find this setting useful because depending on the size you select the courses can use too much disk space
  • By pass check: Bypasses the developer-mode check
  • Quiet: Do not show any output