Development

Prev Next

By going to Quick-access menu > Development there are a number of development tools you can use to fine-tune your Totara experience, including debugging and experimental settings

You might also find our public developer documentation helpful, as it contains a number of useful guides and resources for developers. 

Below you can find explanations about what each of these tools do (except for experimental features and debugging, as these are slightly more complex and therefore have their own dedicated pages). 

Web service test client

The web service test client executes the functions for real, so you should not test functions that you don't know.

All existing web service functions are not yet implemented into the test client. In order to check that a user cannot access some functions, you can test some functions that you didn't allow. To see clearer error messages set the debugging to NORMAL: Show errors, warnings and notices in Debug messages.

Purge all caches

Purge all caches can be accessed via the Administration block within Quick-access menu > Development > Purge all caches.

Totara can cache themes, javascript, language strings, filtered text, RSS feeds, and many other pieces of calculated data. Purging these caches will delete that data from the server and force browsers to refetch data, so that you can be sure you are seeing the most up-to-date values produced by the current code. There is no danger in purging caches, but your site may appear slower for a while until the server and clients calculate new information and caches it.

Make test course

This tool creates standard test courses that include many sections, activities, and files. This is intended to provide a standardised measure for checking the reliability and performance of various system components (such as backup and restore).

This test is important because there have been many cases previously where, faced with real-life use cases (e.g. a course with 1,000 activities), the system does not work. Courses created using this feature can occupy a large amount of database and file system space (tens of gigabytes). You will need to delete the courses (and wait for various cleanup runs) to release this space again.

Do not use this feature on a live system. Use only on a developer server. To avoid accidental use, this feature is disabled unless you have also selected DEVELOPER debugging level.

Make JMeter test plan

This tool creates a JMeter test plan file along with the user credentials file.

This test plan is designed to work along with https://github.com/moodlehq/moodle-performance-comparison, which makes it easier to run the test plan in a specific Totara environment, gathers information about the runs, and compares the results. You will need to download it and use its test_runner.sh script or follow the installation and usage instructions.

You need to set a password for the course users in config.php (e.g. $CFG->tool_generator_users_password = 'totara';). There is no default value for this password to prevent unintended usage of the tool. You need to use the update passwords option in case your course users have other passwords, or they were generated by tool_generator but without setting a $CFG->tool_generator_users_password value.

It is part of tool_generator so it works well with the courses generated by the courses and the site generators, it can also be used with any course that contains, at least:

  • Enough enrolled users (depends on the test plan size you select) with the password reset to 'totara'

  • A page module instance

  • A forum module instance with at least one discussion and one reply

You might want to consider your server's capacity when running large test plans, as the amount to load generated by JMeter can be especially big. The ramp up period has been adjusted according to the number of threads (users) to reduce this kind of issue, but the load is still huge.

Do not run the test plan on a live system. This feature only creates the files to feed JMeter, so is not dangerous by itself, but you should NEVER run this test plan in a production site.

Excimer Profiler

From Totara 19.1, the Excimer profiler is included as a core component to help diagnose and troubleshoot performance issues in production environments. This profiler runs efficiently and safely, capturing performance data for slow requests without impacting system stability.

The profiler is disabled by default, even if the PHP extension is installed and enabled.

Requirements

The Excimer profiler requires the Excimer PHP extension. Follow the instructions on MediaWiki’s documentation to install and enable the extension on your server.

Once installed, the profiler interface is available via:

Quick-access menu > Development > Excimer profiler.

Enabling and Configuring the Profiler

You can configure Excimer via:

Quick-access menu > Development > Excimer profiler > Excimer settings

The following options are available:

Setting

Description

Default

Enable Excimer

Enables or disables the profiler.

Off

Enable auto profiling

Automatically save slow request profiles.

Off

Enable fuzzy counting

Uses approximate counting to track page usage.

Off

Minimum request duration (ms)

Only profile requests slower than this value.

5000

Task min duration (s)

Only profile scheduled tasks slower than this value.

60

Sampling period (ms)

Interval for performance sampling.

10

Processing interval (s)

Frequency of task processing.

10

Sample limit

Max number of samples to retain.

1024

Stack limit

Max recursion/stack depth.

1000

Log expiry (days)

Time before profiles are purged.

30

Months to keep approximate count data

Leave blank to keep data indefinitely.

12

Parameters to be redacted

Automatically removes sensitive parameters (e.g., authtoken, sesskey, etc.).

Enable partial save

Allows saving partial profiles during long-running processes.

Off

Max to save

Maximum number of slow profiles to retain.

1000

Max to save by page

Maximum number of profiles retained per script.

5

Using the Profiler

If auto profiling is enabled, requests slower than the configured threshold (default: 5 seconds) are automatically logged.

You can also manually trigger a profile:

Web example:

/course/view.php?id=2&FLAMEME=1

If there are no existing URL parameters, use ?FLAMEME=1

CLI example:

export FLAMEME=1 && php admin/cli/upgrade.php

Interpreting the Results

Each profile includes a flame graph which visualises the stack trace:

  • X-axis: Alphabetical list of all recorded functions (not chronological)

  • Y-axis: Stack depth (lower = called earlier)

  • Width: Duration of the function call

  • Colour: Aesthetic only — colours don’t carry meaning

Clicking on a box filters to that function and its child calls for easier inspection.

Cleanup and Data Retention

Excimer profiles are automatically cleaned up via scheduled tasks:

  • Expire Excimer logs

  • Purge fastest Excimer profiles

  • Purge page group approximate count data

You can configure how long logs are kept and the number of profiles retained.

Locked Profiles

Some profiles may be locked (with a “Lock Profile Reason”) to protect them from deletion. Locked profiles:

  • Are excluded from cleanup and manual deletion

  • Cannot be deleted in group actions

  • Are preserved for auditing or investigation

Exception: Locked profiles will be deleted if they belong to a user whose data is being purged.

Exporting and Importing Profiles

Export:

You can export a profile as a JSON file for analysis or support reporting. Use the Export profile button on a profile's page.

Review exported data before sharing, as it may include identifiable information.

Import:

To import a profile, your config.php must include PHP:

$CFG->excimer_allow_profile_import = true;

Imported profiles are marked with a “reason” of import.

Other development tools

There is also a range of other tools for developers to utilise including:

  • Third-party libraries

  • Acceptance testing

  • PHPUnit tests

  • Template library

  • XMLDB editor

  • Web API

Join the Totara Community for more resources to help you get the most out of Totara. 


© Copyright 2025 Totara Learning Solutions. All rights reserved. Some content originally obtained via GPLv3 license and continues to be available under GPLv3. All other content is the sole copyright of Totara Learning Solutions.