Use Code Profiler

The Code Profiler provides insight into run-time performance. There are three Code Profiler modes that provide different levels of detail.

  • Production Mode - This mode measures run-time behavior for a subset of requests and provides an aggregated view for systems even under load. This mode is the default for non-sandbox instances and can't be deactivated. Using the Code Profiler in this mode has minimal performance impact.
  • Development Mode - This mode measures run-time behavior for all requests of the system and provides detailed data broken down per request. This mode is the default for sandbox instances and can be activated for other instance types. This mode requires some run-time overhead compared to Production Mode.
  • Extended Script Development Mode - This mode provides insight into script internal run-time behavior, in addition to the information that Development Mode provides. Using the Code Profiler in this mode has severe performance implications. Use with caution in production environments.

All application servers in a cluster always operate in the same Code Profiler mode. The Business Manager Code Profiler screen displays only data gathered on the application server serving the current Business Manager session.

A background job exports the Code Profiler data hourly to the file system into CSV files, which you can download. After the export, the data in the server is reset. The Code Profiler screen shows data only since the last reset.

  1. Open the storefront for the site you want to examine.
  2. Select Administration > Operations > Code Profiler.
  3. Select the mode.
    • Production Mode
    • Development Mode
    • Extended Script Development Mode
      Note: When you change modes, the results are flushed. If you are gathering data on a sandbox, you must make the behavior occur again to measure it. However, if you are gathering data on a production instance that has sufficient traffic, you might simply have to wait to see the behavior.
  4. To change what appears in the results, specify the result types to view.
    Option Description
    Result Type Includes
    Request
    • ONREQUEST: onrequest calls
    • REST_SHOP: OCAP Shop API requests
    • REST_DATA: OCAPI Data API requests
    • REST_BATCH: OCAPI Batch API requests
    • REST_META: OCAPI Meta-API results
    • SF_PAGE: storefront page requests
    • PAGE_DESIGNER: Page Designer requests
    Job
    • JOB: Job execution
    • JOB_STEP: Job steps
    Controller
    • SCRIPT_CONTROLLER: JavaScript controllers
    • PIPELINE: pipelines
    • PIPELINE_NODE: individual pipeline nodes, such as pipelets
    • SCRIPT_PIPELET: script pipelets
    Script details
    • SCRIPT_API: API call
    • SCRIPT_FUNCTION: JavaScript functions
    • SCRIPT_HOOK: Hook function
    • SCRIPT_LINE: single lines of JavaScript code
    View
    • ISML template rendering
  5. To remove results for a result type, uncheck the box next to the filter and click Apply.
  6. To add result types, check the box next to the filter and click Apply.
  7. To sort the results table, click a column heading.